From: Diederik van Lierop Date: Sun, 14 Feb 2010 20:51:07 +0000 (+0100) Subject: Gradient editor: don't show pre-snap indicator when hovering above the knot of a... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9d4e926902cf80d7c3ff083afd29b20dbee464cd;p=inkscape.git Gradient editor: don't show pre-snap indicator when hovering above the knot of a gradient stop --- diff --git a/src/gradient-context.cpp b/src/gradient-context.cpp index 8bdfe2f7c..baf6ac05b 100644 --- a/src/gradient-context.cpp +++ b/src/gradient-context.cpp @@ -593,7 +593,7 @@ sp_gradient_context_root_handler(SPEventContext *event_context, GdkEvent *event) ret = TRUE; } else { - if (!sp_event_context_knot_mouseover(event_context)) { + if (!drag->mouseOver()) { SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop); diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 0b9068b37..246573e3f 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -1662,6 +1662,22 @@ GrDrag::updateDraggers () } } + +/** + * \brief Returns true if at least one of the draggers' knots has the mouse hovering above it + */ + +bool +GrDrag::mouseOver() +{ + for (GList const* i = this->draggers; i != NULL; i = i->next) { + GrDragger *d = (GrDragger *) i->data; + if (d->knot && (d->knot->flags & SP_KNOT_MOUSEOVER)) { + return true; + } + } + return false; +} /** Regenerates the lines list from the current selection; is called on each move of a dragger, so that lines are always in sync with the actual gradient diff --git a/src/gradient-drag.h b/src/gradient-drag.h index a53acffe6..460d1396e 100644 --- a/src/gradient-drag.h +++ b/src/gradient-drag.h @@ -154,6 +154,8 @@ public: // FIXME: make more of this private! void updateLines (); void updateLevels (); + bool mouseOver(); + void selected_move_nowrite (double x, double y, bool scale_radial); void selected_move (double x, double y, bool write_repr = true, bool scale_radial = false); void selected_move_screen (double x, double y);