GUI: allow cursor movement when stepping

This commit is contained in:
tildearrow 2022-04-14 03:05:58 -05:00
parent 55e085b148
commit 11516d7923
4 changed files with 9 additions and 3 deletions

View File

@ -86,6 +86,7 @@ void FurnaceGUI::drawEditControls() {
ImGui::SameLine();
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
e->stepOne(cursor.y);
pendingStepUpdate=true;
}
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
@ -105,6 +106,7 @@ void FurnaceGUI::drawEditControls() {
ImGui::SameLine();
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
e->stepOne(cursor.y);
pendingStepUpdate=true;
}
ImGui::SameLine();
@ -182,6 +184,7 @@ void FurnaceGUI::drawEditControls() {
}
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
e->stepOne(cursor.y);
pendingStepUpdate=true;
}
bool repeatPattern=e->getRepeatPattern();
@ -272,6 +275,7 @@ void FurnaceGUI::drawEditControls() {
ImGui::SameLine();
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
e->stepOne(cursor.y);
pendingStepUpdate=true;
}
ImGui::SameLine();

View File

@ -3629,6 +3629,7 @@ FurnaceGUI::FurnaceGUI():
fadeMode(false),
randomMode(false),
haveHitBounds(false),
pendingStepUpdate(false),
oldOrdersLen(0),
sampleZoom(1.0),
prevSampleZoom(1.0),

View File

@ -1011,7 +1011,7 @@ class FurnaceGUI {
int dummyRows, demandX;
int transposeAmount, randomizeMin, randomizeMax, fadeMin, fadeMax;
float scaleMax;
bool fadeMode, randomMode, haveHitBounds;
bool fadeMode, randomMode, haveHitBounds, pendingStepUpdate;
int oldOrdersLen;
DivOrders oldOrders;

View File

@ -380,7 +380,7 @@ void FurnaceGUI::drawPattern() {
bool inhibitMenu=false;
float scrollX=0;
if (e->isPlaying() && followPattern) cursor.y=oldRow;
if (e->isPlaying() && followPattern && (!e->isStepping() || pendingStepUpdate)) cursor.y=oldRow+((pendingStepUpdate)?1:0);
demandX=0;
sel1=selStart;
sel2=selEnd;
@ -429,7 +429,8 @@ void FurnaceGUI::drawPattern() {
char chanID[2048];
float lineHeight=(ImGui::GetTextLineHeight()+2*dpiScale);
int curRow=e->getRow();
if (e->isPlaying() && followPattern) updateScroll(curRow);
if (e->isPlaying() && followPattern && (!e->isStepping() || pendingStepUpdate)) updateScroll(curRow);
pendingStepUpdate=false;
if (nextScroll>-0.5f) {
ImGui::SetScrollY(nextScroll);
nextScroll=-1.0f;