GUI: more fixes to drag to move

This commit is contained in:
tildearrow 2022-06-19 19:07:38 -05:00
parent 35bc757adf
commit d66ff353ba

View file

@ -100,8 +100,16 @@ void FurnaceGUI::updateSelection(int xCoarse, int xFine, int y, bool fullRow) {
dragDestinationX=dragSourceX-dragStart.xCoarse;
}
if (dragEnd.xCoarse+(dragDestinationX-dragSourceX)>lastChannel) {
if (dragEnd.xCoarse+(dragDestinationX-dragSourceX)>=lastChannel) {
dragDestinationX=lastChannel-(dragEnd.xCoarse-dragSourceX)-1;
}
if (dragStart.y+(dragDestinationY-dragSourceY)<0) {
dragDestinationY=dragSourceY-dragStart.y;
}
if (dragEnd.y+(dragDestinationY-dragSourceY)>=e->curSubSong->patLen) {
dragDestinationY=e->curSubSong->patLen-(dragEnd.y-dragSourceY)-1;
}
selStart.xCoarse=dragStart.xCoarse+(dragDestinationX-dragSourceX);