GUI: fix expand selection upwards

This commit is contained in:
tildearrow 2023-08-22 20:23:21 -05:00
parent cc8c79375d
commit 577d6fd4d4
2 changed files with 23 additions and 4 deletions

View File

@ -374,7 +374,9 @@ void FurnaceGUI::moveCursorNextChannel(bool overflow) {
} }
void FurnaceGUI::moveCursorTop(bool select) { void FurnaceGUI::moveCursorTop(bool select) {
finishSelection(); if (!select) {
finishSelection();
}
curNibble=false; curNibble=false;
if (cursor.y==0) { if (cursor.y==0) {
DETERMINE_FIRST; DETERMINE_FIRST;
@ -384,16 +386,18 @@ void FurnaceGUI::moveCursorTop(bool select) {
} else { } else {
cursor.y=0; cursor.y=0;
} }
selStart=cursor;
if (!select) { if (!select) {
selEnd=cursor; selStart=cursor;
} }
selEnd=cursor;
e->setMidiBaseChan(cursor.xCoarse); e->setMidiBaseChan(cursor.xCoarse);
updateScroll(cursor.y); updateScroll(cursor.y);
} }
void FurnaceGUI::moveCursorBottom(bool select) { void FurnaceGUI::moveCursorBottom(bool select) {
finishSelection(); if (!select) {
finishSelection();
}
curNibble=false; curNibble=false;
if (cursor.y==e->curSubSong->patLen-1) { if (cursor.y==e->curSubSong->patLen-1) {
DETERMINE_LAST; DETERMINE_LAST;

View File

@ -308,6 +308,21 @@ void FurnaceGUI::drawDebug() {
} }
ImGui::TreePop(); ImGui::TreePop();
} }
if (ImGui::TreeNode("Do Action")) {
char bindID[1024];
for (int j=0; j<GUI_ACTION_MAX; j++) {
if (strcmp(guiActions[j].friendlyName,"")==0) continue;
if (strstr(guiActions[j].friendlyName,"---")==guiActions[j].friendlyName) {
ImGui::TextUnformatted(guiActions[j].friendlyName);
} else {
snprintf(bindID,1024,"%s##DO_%d",guiActions[j].friendlyName,j);
if (ImGui::Button(bindID)) {
doAction(j);
}
}
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Pitch Table Calculator")) { if (ImGui::TreeNode("Pitch Table Calculator")) {
ImGui::InputDouble("Clock",&ptcClock); ImGui::InputDouble("Clock",&ptcClock);
ImGui::InputDouble("Divider/FreqBase",&ptcDivider); ImGui::InputDouble("Divider/FreqBase",&ptcDivider);