From e2bfbbf9b146454b4cb6013f2e95ebfaa23a2211 Mon Sep 17 00:00:00 2001 From: Hombre Date: Sun, 18 Aug 2019 00:26:15 +0200 Subject: [PATCH 1/5] Bugfix: Edit button was not switched off when opening a new image Reported in issue #2239 : https://github.com/Beep6581/RawTherapee/issues/2239#issuecomment-521955110 --- rtgui/editorpanel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 1f8e83c3e..053586bca 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1090,8 +1090,8 @@ void EditorPanel::close () if (iareapanel) { iareapanel->imageArea->setPreviewHandler (nullptr); iareapanel->imageArea->setImProcCoordinator (nullptr); - iareapanel->imageArea->unsubscribe(); } + tpc->editModeSwitchedOff(); rtengine::StagedImageProcessor::destroy (ipc); ipc = nullptr; From f5a18f6248d0736ca1b4571a7b3966aa2deb0935 Mon Sep 17 00:00:00 2001 From: Hombre Date: Sun, 18 Aug 2019 01:54:31 +0200 Subject: [PATCH 2/5] Hovered edit object wasn't dragged if inside a red crop's rectangle Fix issue #5415 --- rtgui/cropwindow.cc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 5839a5edb..41c626015 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -404,6 +404,26 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y) action_y = 0; needRedraw = true; } + } else if (iarea->getToolMode () == TMHand + && editSubscriber + && cropgl + && cropgl->inImageArea(iarea->posImage.x, iarea->posImage.y) + && editSubscriber->getEditingType() == ET_OBJECTS + && iarea->getObject() >= 0 + ) + { + needRedraw = editSubscriber->button1Pressed(bstate); + if (editSubscriber->isDragging()) { + state = SEditDrag1; + } else if (editSubscriber->isPicking()) { + state = SEditPick1; + pickedObject = iarea->getObject(); + pickModifierKey = bstate; + } + press_x = x; + press_y = y; + action_x = 0; + action_y = 0; } else if (onArea (CropTopLeft, x, y)) { state = SResizeTL; press_x = x; @@ -477,7 +497,7 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y) cropgl->cropInit (cropHandler.cropParams->x, cropHandler.cropParams->y, cropHandler.cropParams->w, cropHandler.cropParams->h); } else if (iarea->getToolMode () == TMHand) { if (editSubscriber) { - if ((cropgl && cropgl->inImageArea(iarea->posImage.x, iarea->posImage.y) && (editSubscriber->getEditingType() == ET_PIPETTE && (bstate & GDK_CONTROL_MASK))) || editSubscriber->getEditingType() == ET_OBJECTS) { + if ((cropgl && cropgl->inImageArea(iarea->posImage.x, iarea->posImage.y) && editSubscriber->getEditingType() == ET_PIPETTE && (bstate & GDK_CONTROL_MASK))) { needRedraw = editSubscriber->button1Pressed(bstate); if (editSubscriber->isDragging()) { state = SEditDrag1; @@ -492,7 +512,7 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y) action_y = 0; } } - if (state != SEditDrag1) { + if (state != SEditDrag1 && state != SEditPick1) { state = SCropImgMove; press_x = x; press_y = y; From ee38731328e3b4868650b5eb3a88779a6935998b Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 18 Aug 2019 10:44:59 +0200 Subject: [PATCH 3/5] fixes #5416 --- rtgui/filebrowser.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 88220a688..f60e47518 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -1502,8 +1502,8 @@ bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) const // true -> std::transform(FileName.begin(), FileName.end(), FileName.begin(), ::toupper); int iFilenameMatch = 0; - for (const auto& filter : filter.vFilterStrings) { - if (FileName.find(filter) != std::string::npos) { + for (const auto& filterString : filter.vFilterStrings) { + if (FileName.find(filterString) != std::string::npos) { ++iFilenameMatch; break; } From 8bb88073fa1fd59ec9723a521a7a890838520f75 Mon Sep 17 00:00:00 2001 From: Hombre Date: Sun, 18 Aug 2019 17:12:37 +0200 Subject: [PATCH 4/5] Fixing object precedence in getCursor as well + resize of the "catching spot" of the Gradient widget (30 -> 12) --- rtgui/cropwindow.cc | 2 ++ rtgui/gradient.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 41c626015..a170ec04d 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -1276,6 +1276,8 @@ void CropWindow::updateCursor (int x, int y) newType = CSArrow; } else if (onArea (CropToolBar, x, y)) { newType = CSMove; + } else if (iarea->getObject() > -1 && editSubscriber && editSubscriber->getEditingType() == ET_OBJECTS) { + newType = editSubscriber->getCursor(iarea->getObject()); } else if (onArea (CropResize, x, y)) { newType = CSResizeDiagonal; } else if (tm == TMColorPicker && hoveredPicker) { diff --git a/rtgui/gradient.cc b/rtgui/gradient.cc index 3f13dfe4d..4f389e112 100644 --- a/rtgui/gradient.cc +++ b/rtgui/gradient.cc @@ -93,7 +93,7 @@ Gradient::Gradient () : FoldableToolPanel(this, "gradient", M("TP_GRADIENT_LABEL centerCircle = new Circle(); centerCircle->datum = Geometry::IMAGE; centerCircle->radiusInImageSpace = false; - centerCircle->radius = 30; + centerCircle->radius = 12; centerCircle->filled = true; EditSubscriber::mouseOverGeometry.push_back( hLine ); From 6b12f299e698be8e26efd30f8594afb56bf00d6a Mon Sep 17 00:00:00 2001 From: Hombre Date: Sun, 18 Aug 2019 18:20:32 +0200 Subject: [PATCH 5/5] On preview widgets for main crop window is now clipped to avoid drawing on the whole window. Fix issue #5418 --- rtgui/cropwindow.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 5839a5edb..72d2500ba 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -1845,11 +1845,9 @@ void CropWindow::expose (Cairo::RefPtr cr) EditSubscriber *editSubscriber = iarea->getCurrSubscriber(); if (editSubscriber && editSubscriber->getEditingType() == ET_OBJECTS && bufferCreated()) { - if (this != iarea->mainCropWindow) { - cr->set_line_width (0.); - cr->rectangle (x + imgAreaX, y + imgAreaY, imgAreaW, imgAreaH); - cr->clip(); - } + cr->set_line_width (0.); + cr->rectangle (x + imgAreaX, y + imgAreaY, imgAreaW, imgAreaH); + cr->clip(); // drawing Subscriber's visible geometry const std::vector visibleGeom = editSubscriber->getVisibleGeometry();