mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-28 15:33:01 +00:00
Move pattern finishSelection out of SDL-triggered pointUp, and replace with ImGui release trigger in drawPattern. This prevents down/up events from being processed out of order by two separate event systems, causing selection to be stuck on if the up event is recieved within 1 frame of the down event.
This commit is contained in:
parent
edb48d47be
commit
a37260bcaa
2 changed files with 15 additions and 13 deletions
|
@ -3235,19 +3235,6 @@ void FurnaceGUI::pointUp(int x, int y, int button) {
|
|||
if (dragMobileEditButton) {
|
||||
dragMobileEditButton=false;
|
||||
}
|
||||
if (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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FurnaceGUI::pointMotion(int x, int y, int xrel, int yrel) {
|
||||
|
|
|
@ -934,6 +934,21 @@ 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();
|
||||
oldRow=curRow;
|
||||
|
|
Loading…
Reference in a new issue