From a2c5fd0f919f4a75ccb5b7537ae12ac55391e7d9 Mon Sep 17 00:00:00 2001 From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com> Date: Sat, 12 Jun 2021 11:37:38 -0700 Subject: [PATCH 1/2] Fix drag position after alternate button press When a button is released and the edit state is not "dragging", reset the drag delta to zero. There was a problem with the spot removal spots being dragged. If a spot is deleted while being dragged, dragging another spot will cause a jump. --- rtgui/cropwindow.cc | 7 +++++++ rtgui/spot.cc | 1 + 2 files changed, 8 insertions(+) diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index b612de2e7..2927cdf32 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -794,6 +794,13 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y) iarea->setToolHand (); } + if (state != SEditDrag1 && state != SEditDrag2 && state != SEditDrag3) { + iarea->deltaImage.set(0, 0); + iarea->deltaScreen.set(0, 0); + iarea->deltaPrevImage.set(0, 0); + iarea->deltaPrevScreen.set(0, 0); + } + if (cropgl && (state == SCropSelecting || state == SResizeH1 || state == SResizeH2 || state == SResizeW1 || state == SResizeW2 || state == SResizeTL || state == SResizeTR || state == SResizeBL || state == SResizeBR || state == SCropMove)) { cropgl->cropManipReady (); iarea->setToolHand (); diff --git a/rtgui/spot.cc b/rtgui/spot.cc index 35028415b..4f2d700cc 100644 --- a/rtgui/spot.cc +++ b/rtgui/spot.cc @@ -667,6 +667,7 @@ bool Spot::button3Pressed (int modifierKey) return true; } else if (! (modifierKey & (GDK_SHIFT_MASK | GDK_SHIFT_MASK))) { EditSubscriber::action = EditSubscriber::Action::PICKING; + return true; } return false; From c13cc02768e17271e8a93fde34790fcec0865c3b Mon Sep 17 00:00:00 2001 From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com> Date: Sat, 12 Jun 2021 11:46:54 -0700 Subject: [PATCH 2/2] Un-highlight spot removal spots after deletion --- rtgui/spot.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rtgui/spot.cc b/rtgui/spot.cc index 4f2d700cc..07425ee4b 100644 --- a/rtgui/spot.cc +++ b/rtgui/spot.cc @@ -428,6 +428,11 @@ void Spot::updateGeometry() sourceCircle.setVisible(draggedSide != DraggedSide::SOURCE); targetCircle.setVisible(draggedSide != DraggedSide::TARGET); } else { + targetCircle.state = Geometry::NORMAL; + sourceCircle.state = Geometry::NORMAL; + targetFeatherCircle.state = Geometry::NORMAL; + sourceFeatherCircle.state = Geometry::NORMAL; + targetCircle.setActive (false); targetMODisc.setActive (false); sourceIcon.setActive (false);