summaryrefslogtreecommitdiffstats
path: root/src/gradient-drag.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-11-01 23:54:29 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-11-01 23:54:29 +0000
commit98c1a5967664c6c51c4f591e700364c25c7da5e7 (patch)
tree70ae6f7b4292f816e430020b80ed3ba689e5de58 /src/gradient-drag.cpp
parentadd deletion of layer_manager to SPDesktop::destroy (diff)
downloadinkscape-98c1a5967664c6c51c4f591e700364c25c7da5e7.tar.gz
inkscape-98c1a5967664c6c51c4f591e700364c25c7da5e7.zip
fix bug [ 1824359 ] Gradient isn't snapping with ctrl pressed
(bzr r4011)
Diffstat (limited to 'src/gradient-drag.cpp')
-rw-r--r--src/gradient-drag.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 5d74b561e..ff15e8b8e 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -641,7 +641,6 @@ gr_knot_moved_handler(SPKnot *knot, NR::Point const *ppointer, guint state, gpoi
continue;
if (d_new->isA (draggable->item,
draggable->point_type == POINT_LG_BEGIN? POINT_LG_END : POINT_LG_BEGIN,
- draggable->point_i,
draggable->fill_or_stroke)) {
// found the other end of the linear gradient;
if (state & GDK_SHIFT_MASK) {
@@ -661,7 +660,6 @@ gr_knot_moved_handler(SPKnot *knot, NR::Point const *ppointer, guint state, gpoi
continue;
if (d_new->isA (draggable->item,
POINT_RG_CENTER,
- draggable->point_i,
draggable->fill_or_stroke)) {
// found the center of the radial gradient;
dr_snap = &(d_new->point);
@@ -1025,7 +1023,7 @@ GrDragger::isA (gint point_type)
}
/**
-Checks if the dragger has a draggable with this item, point_type, fill_or_stroke
+Checks if the dragger has a draggable with this item, point_type + point_i (number), fill_or_stroke
*/
bool
GrDragger::isA (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke)
@@ -1039,6 +1037,21 @@ GrDragger::isA (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke
return false;
}
+/**
+Checks if the dragger has a draggable with this item, point_type, fill_or_stroke
+ */
+bool
+GrDragger::isA (SPItem *item, gint point_type, bool fill_or_stroke)
+{
+ for (GSList const* i = this->draggables; i != NULL; i = i->next) {
+ GrDraggable *draggable = (GrDraggable *) i->data;
+ if ( (draggable->point_type == point_type) && (draggable->item == item) && (draggable->fill_or_stroke == fill_or_stroke) ) {
+ return true;
+ }
+ }
+ return false;
+}
+
bool
GrDraggable::mayMerge (GrDraggable *da2)
{