Spot removal : differentiating source/dest, betted cursor handling

+ some code cleanup from floessie (see issue #2239)
This commit is contained in:
Hombre
2019-09-01 02:08:48 +02:00
parent 4b7e8b7705
commit 82e7caa635
14 changed files with 222 additions and 132 deletions

View File

@@ -24,6 +24,7 @@
#include "editbuffer.h"
#include "editcoordsys.h"
#include "../rtengine/coord.h"
#include "../rtengine/rt_math.h"
class ObjectMOBuffer;
@@ -208,6 +209,8 @@ public:
F_VISIBLE = 1 << 0, /// true if the geometry have to be drawn on the visible layer
F_HOVERABLE = 1 << 1, /// true if the geometry have to be drawn on the "mouse over" layer
F_AUTO_COLOR = 1 << 2, /// true if the color depend on the state value, not the color field above
F_DASHED = 1 << 3, /// true if the geometry have to be drawn as a dash line
// (TODO: add a F_LARGE_DASH to have two different dash size ?)
};
/// @brief Key point of the image's rectangle that is used to locate the icon copy to the target point:
@@ -224,6 +227,7 @@ public:
};
protected:
static const std::vector<double> dash;
RGBColor innerLineColor;
RGBColor outerLineColor;
short flags;
@@ -249,6 +253,8 @@ public:
void setVisible (bool visible);
bool isHoverable ();
void setHoverable (bool visible);
bool isDashed ();
void setDashed (bool dashed);
// setActive will enable/disable the visible and hoverable flags in one shot!
@@ -427,7 +433,7 @@ inline void Geometry::setOuterLineColor (char r, char g, char b) {
}
inline double Geometry::getMouseOverLineWidth () {
return getOuterLineWidth () + 2.;
return rtengine::max(double(innerLineWidth), 1.) + 2.;
}
inline void Geometry::setAutoColor (bool aColor) {
@@ -462,6 +468,18 @@ inline void Geometry::setHoverable (bool hoverable) {
}
}
inline bool Geometry::isDashed () {
return flags & F_DASHED;
}
inline void Geometry::setDashed (bool dashed) {
if (dashed) {
flags |= F_DASHED;
} else {
flags &= ~F_DASHED;
}
}
inline void Geometry::setActive (bool active) {
if (active) {
flags |= (F_VISIBLE | F_HOVERABLE);