GUI: allow cursor movement when stepping
This commit is contained in:
parent
55e085b148
commit
11516d7923
|
@ -86,6 +86,7 @@ void FurnaceGUI::drawEditControls() {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
||||||
e->stepOne(cursor.y);
|
e->stepOne(cursor.y);
|
||||||
|
pendingStepUpdate=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
|
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
|
||||||
|
@ -105,6 +106,7 @@ void FurnaceGUI::drawEditControls() {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
||||||
e->stepOne(cursor.y);
|
e->stepOne(cursor.y);
|
||||||
|
pendingStepUpdate=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
@ -182,6 +184,7 @@ void FurnaceGUI::drawEditControls() {
|
||||||
}
|
}
|
||||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
||||||
e->stepOne(cursor.y);
|
e->stepOne(cursor.y);
|
||||||
|
pendingStepUpdate=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool repeatPattern=e->getRepeatPattern();
|
bool repeatPattern=e->getRepeatPattern();
|
||||||
|
@ -272,6 +275,7 @@ void FurnaceGUI::drawEditControls() {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
||||||
e->stepOne(cursor.y);
|
e->stepOne(cursor.y);
|
||||||
|
pendingStepUpdate=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
|
@ -3629,6 +3629,7 @@ FurnaceGUI::FurnaceGUI():
|
||||||
fadeMode(false),
|
fadeMode(false),
|
||||||
randomMode(false),
|
randomMode(false),
|
||||||
haveHitBounds(false),
|
haveHitBounds(false),
|
||||||
|
pendingStepUpdate(false),
|
||||||
oldOrdersLen(0),
|
oldOrdersLen(0),
|
||||||
sampleZoom(1.0),
|
sampleZoom(1.0),
|
||||||
prevSampleZoom(1.0),
|
prevSampleZoom(1.0),
|
||||||
|
|
|
@ -1011,7 +1011,7 @@ class FurnaceGUI {
|
||||||
int dummyRows, demandX;
|
int dummyRows, demandX;
|
||||||
int transposeAmount, randomizeMin, randomizeMax, fadeMin, fadeMax;
|
int transposeAmount, randomizeMin, randomizeMax, fadeMin, fadeMax;
|
||||||
float scaleMax;
|
float scaleMax;
|
||||||
bool fadeMode, randomMode, haveHitBounds;
|
bool fadeMode, randomMode, haveHitBounds, pendingStepUpdate;
|
||||||
|
|
||||||
int oldOrdersLen;
|
int oldOrdersLen;
|
||||||
DivOrders oldOrders;
|
DivOrders oldOrders;
|
||||||
|
|
|
@ -380,7 +380,7 @@ void FurnaceGUI::drawPattern() {
|
||||||
bool inhibitMenu=false;
|
bool inhibitMenu=false;
|
||||||
float scrollX=0;
|
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;
|
demandX=0;
|
||||||
sel1=selStart;
|
sel1=selStart;
|
||||||
sel2=selEnd;
|
sel2=selEnd;
|
||||||
|
@ -429,7 +429,8 @@ void FurnaceGUI::drawPattern() {
|
||||||
char chanID[2048];
|
char chanID[2048];
|
||||||
float lineHeight=(ImGui::GetTextLineHeight()+2*dpiScale);
|
float lineHeight=(ImGui::GetTextLineHeight()+2*dpiScale);
|
||||||
int curRow=e->getRow();
|
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) {
|
if (nextScroll>-0.5f) {
|
||||||
ImGui::SetScrollY(nextScroll);
|
ImGui::SetScrollY(nextScroll);
|
||||||
nextScroll=-1.0f;
|
nextScroll=-1.0f;
|
||||||
|
|
Loading…
Reference in a new issue