From 75541d6281f7d706bf4d0d3079fd6856fc62abe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Batty=C3=A1nyi?= <86350313+LoKolbasz@users.noreply.github.com> Date: Sun, 20 Aug 2023 13:59:42 +0200 Subject: [PATCH] Changes to get the full spot width where needed --- rtgui/filmnegative.cc | 8 ++++---- rtgui/guiutils.h | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rtgui/filmnegative.cc b/rtgui/filmnegative.cc index 4c1692bf1..e9c9f4d4c 100644 --- a/rtgui/filmnegative.cc +++ b/rtgui/filmnegative.cc @@ -538,7 +538,7 @@ bool FilmNegative::mouseOver(int modifierKey) { EditDataProvider* const provider = getEditProvider(); EditRectangle* const spotRect = static_cast(visibleGeometry.at(0)); - spotRect->setXYWH(provider->posImage.x - activePicker->get_spot_half_width(), provider->posImage.y - activePicker->get_spot_half_width() ,activePicker->get_spot_half_width() * 2, activePicker->get_spot_half_width() * 2); + spotRect->setXYWH(provider->posImage.x - activePicker->get_spot_half_width(), provider->posImage.y - activePicker->get_spot_half_width() ,activePicker->get_spot_full_width(), activePicker->get_spot_full_width()); return true; } @@ -560,8 +560,8 @@ bool FilmNegative::button1Pressed(int modifierKey) RGB ref1, ref2, dummy; - if (fnp->getFilmNegativeSpot(refSpotCoords[0], picker.get_spot_half_width(), ref1, dummy) && - fnp->getFilmNegativeSpot(refSpotCoords[1], picker.get_spot_half_width(), ref2, dummy)) { + if (fnp->getFilmNegativeSpot(refSpotCoords[0], picker.get_spot_full_width(), ref1, dummy) && + fnp->getFilmNegativeSpot(refSpotCoords[1], picker.get_spot_full_width(), ref2, dummy)) { disableListener(); @@ -607,7 +607,7 @@ bool FilmNegative::button1Pressed(int modifierKey) } RGB refOut; - fnp->getFilmNegativeSpot(provider->posImage, refPicker.get_spot_half_width(), refInputValues, refOut); + fnp->getFilmNegativeSpot(provider->posImage, refPicker.get_spot_full_width(), refInputValues, refOut); // Output luminance of the sampled spot float spotLum = rtengine::Color::rgbLuminance(refOut.r, refOut.g, refOut.b); diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 221a56814..02811e076 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -740,6 +740,10 @@ class SpotPicker : public Gtk::Grid { return _spotHalfWidth; } + int get_spot_full_width() const + { + return _spotHalfWidth * 2; + } template void add_button_toggled_event(T_return& returnv, const T_obj function) { _spotButton.signal_toggled().connect(sigc::mem_fun(returnv, function));