diff --git a/rtengine/spot.cc b/rtengine/spot.cc index b12f5bc40..2244d882e 100644 --- a/rtengine/spot.cc +++ b/rtengine/spot.cc @@ -106,17 +106,8 @@ public: return *this; } - /* - float fv = float(v); - x1 = int(float(x1) / fv + 0.5f); - y1 = int(float(y1) / fv + 0.5f); - x2 = int(float(x2) / fv + 0.5f); - y2 = int(float(y2) / fv + 0.5f); - */ - - // Aletrnate rounding possibility int w = x2 - x1 + 1; - int h = x2 - x1 + 1; + int h = y2 - y1 + 1; w = w / v + (w % v > 0); h = h / v + (h % v > 0); x1 /= v; @@ -188,7 +179,7 @@ public: } spotArea /= v; imgArea /= v; - radius = radius / float(v); + radius /= float(v); featherRadius = getWidth() / 2.f; // intersectionArea doesn't need resize, because it's set after resizing return *this; diff --git a/rtgui/spot.cc b/rtgui/spot.cc index 9c5702aa3..9a957f77a 100644 --- a/rtgui/spot.cc +++ b/rtgui/spot.cc @@ -432,7 +432,7 @@ void Spot::deleteSelectedEntry() } // TODO -CursorShape Spot::getCursor (int objectID) +CursorShape Spot::getCursor (int objectID) const { return CSHandOpen; } diff --git a/rtgui/spot.h b/rtgui/spot.h index eea5e8933..aa0daa4ca 100644 --- a/rtgui/spot.h +++ b/rtgui/spot.h @@ -103,7 +103,7 @@ public: void setBatchMode (bool batchMode) override; // EditSubscriber interface - CursorShape getCursor (int objectID); + CursorShape getCursor (int objectID) const; bool mouseOver (int modifierKey) override; bool button1Pressed (int modifierKey) override; bool button1Released () override; @@ -117,7 +117,7 @@ public: void switchOffEditMode () override; //TweakOperator interface - void tweakParams(rtengine::procparams::ProcParams& pparams); + void tweakParams(rtengine::procparams::ProcParams& pparams) override; rtengine::ProcEvent EvSpotEnabled; rtengine::ProcEvent EvSpotEnabledOPA; // used to toggle-on the Spot 'On Preview Adjustment' mode