GUI: add more options for selection drag

ability to copy by dragging selection
This commit is contained in:
tildearrow 2025-01-31 17:29:51 -05:00
parent e22d46e619
commit b64c06dd4d
6 changed files with 21 additions and 7 deletions

View file

@ -43,7 +43,7 @@ void FurnaceGUI::startSelection(int xCoarse, int xFine, int y, bool fullRow) {
}
}
if ((settings.dragMovesSelection==1 || (settings.dragMovesSelection==2 && (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)))) && !fullRow) {
if (((settings.dragMovesSelection==1 || settings.dragMovesSelection==3 || settings.dragMovesSelection==5) || ((settings.dragMovesSelection==2 || settings.dragMovesSelection==4) && (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)))) && !fullRow) {
if (xCoarse>=selStart.xCoarse && (xFine>=selStart.xFine || xCoarse>selStart.xCoarse) && y>=selStart.y &&
xCoarse<=selEnd.xCoarse && (xFine<=selEnd.xFine || xCoarse<selEnd.xCoarse) && y<=selEnd.y) {
dragging=true;
@ -176,7 +176,7 @@ void FurnaceGUI::finishSelection() {
selStart=cursorDrag;
selEnd=cursorDrag;
} else { // perform drag
doDrag();
doDrag(settings.dragMovesSelection==3 || settings.dragMovesSelection==4 || (settings.dragMovesSelection==5 && (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl))));
}
dragging=false;