mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-30 08:23:01 +00:00
relocate pattern mouse release handling to FurnaceGui::Loop
This commit is contained in:
parent
a37260bcaa
commit
fd27a41c08
2 changed files with 15 additions and 14 deletions
|
@ -4488,6 +4488,21 @@ bool FurnaceGUI::loop() {
|
|||
MEASURE(effectList,drawEffectList());
|
||||
}
|
||||
|
||||
// release selection if mouse released
|
||||
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && selecting) {
|
||||
if (!selectingFull) cursor=selEnd;
|
||||
finishSelection();
|
||||
if (!mobileUI) {
|
||||
demandScrollX=true;
|
||||
if (cursor.xCoarse==selStart.xCoarse && cursor.xFine==selStart.xFine && cursor.y==selStart.y &&
|
||||
cursor.xCoarse==selEnd.xCoarse && cursor.xFine==selEnd.xFine && cursor.y==selEnd.y) {
|
||||
if (!settings.cursorMoveNoScroll) {
|
||||
updateScroll(cursor.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
activateTutorial(GUI_TUTORIAL_OVERVIEW);
|
||||
|
||||
if (inspectorOpen) ImGui::ShowMetricsWindow(&inspectorOpen);
|
||||
|
|
|
@ -934,20 +934,6 @@ void FurnaceGUI::drawPattern() {
|
|||
ImGui::TableNextColumn();
|
||||
}
|
||||
}
|
||||
// release selection if mouse released
|
||||
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && selecting) {
|
||||
if (!selectingFull) cursor=selEnd;
|
||||
finishSelection();
|
||||
if (!mobileUI) {
|
||||
demandScrollX=true;
|
||||
if (cursor.xCoarse==selStart.xCoarse && cursor.xFine==selStart.xFine && cursor.y==selStart.y &&
|
||||
cursor.xCoarse==selEnd.xCoarse && cursor.xFine==selEnd.xFine && cursor.y==selEnd.y) {
|
||||
if (!settings.cursorMoveNoScroll) {
|
||||
updateScroll(cursor.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndDisabled();
|
||||
ImGui::PopStyleVar();
|
||||
|
|
Loading…
Reference in a new issue