GUI: improve drag-and-drop, part 2 - BROKEN

This commit is contained in:
tildearrow 2023-01-30 03:43:46 -05:00
parent 72465cf09a
commit 311c66ff9f
1 changed files with 7 additions and 6 deletions

View File

@ -88,7 +88,7 @@ void FurnaceGUI::updateSelection(int xCoarse, int xFine, int y, bool fullRow) {
if (!selecting) return; if (!selecting) return;
if (dragging) { if (dragging) {
dragDestinationX=xCoarse; dragDestinationX=xCoarse;
if (dragStart.xFine>=3) dragDestinationXFine=(xFine|1); if (dragStart.xFine>=3 && dragStart.xCoarse==dragEnd.xCoarse) dragDestinationXFine=(dragSourceXFine&1)?((xFine-1)|1):((xFine+1)&(~1));
dragDestinationY=y; dragDestinationY=y;
cursorDrag.xCoarse=xCoarse; cursorDrag.xCoarse=xCoarse;
cursorDrag.xFine=xFine; cursorDrag.xFine=xFine;
@ -107,12 +107,13 @@ void FurnaceGUI::updateSelection(int xCoarse, int xFine, int y, bool fullRow) {
dragDestinationX=lastChannel-(dragEnd.xCoarse-dragSourceX)-1; dragDestinationX=lastChannel-(dragEnd.xCoarse-dragSourceX)-1;
} }
if (dragStart.xFine>=3) { if (dragStart.xFine>=3 && dragStart.xCoarse==dragEnd.xCoarse) {
logV("ddd: %d",dragStart.xFine+(dragDestinationXFine-dragSourceXFine)); if (dragEnd.xFine+(dragDestinationXFine-dragSourceXFine)>(2+e->curPat[dragDestinationX].effectCols*2)) {
if (dragStart.xFine+(dragDestinationXFine-dragSourceXFine)<3) { dragDestinationXFine=(2+e->curPat[dragDestinationX].effectCols*2)-dragEnd.xFine+dragSourceXFine;
dragDestinationXFine=dragStart.xFine+dragSourceXFine-3; }
if (dragStart.xFine+(dragDestinationXFine-dragSourceXFine)<3) {
dragDestinationXFine=3-dragStart.xFine+dragSourceXFine;
} }
logV("ddxf: %d",dragDestinationXFine);
} }
if (dragStart.y+(dragDestinationY-dragSourceY)<0) { if (dragStart.y+(dragDestinationY-dragSourceY)<0) {