summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5aa46db)
raw | patch | inline | side by side (parent: 5aa46db)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 1 Nov 2007 23:54:29 +0000 (23:54 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 1 Nov 2007 23:54:29 +0000 (23:54 +0000) |
src/gradient-drag.cpp | patch | blob | history | |
src/gradient-drag.h | patch | blob | history |
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 5d74b561eece74786d9942dd6f27c31644890f63..ff15e8b8e8382370bf2e206ed19961f760701368 100644 (file)
--- 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);
}
/**
-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)
{
diff --git a/src/gradient-drag.h b/src/gradient-drag.h
index 2e547b1832e5e006a94d5c1fc021f522217ed926..06859c24bb0e5fba115739e6679348f8006b9fc1 100644 (file)
--- a/src/gradient-drag.h
+++ b/src/gradient-drag.h
bool mayMerge (GrDragger *other);
bool mayMerge (GrDraggable *da2);
- bool isA (gint point_type);
- bool isA (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke);
+ bool isA (gint point_type);
+ bool isA (SPItem *item, gint point_type, bool fill_or_stroke);
+ bool isA (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke);
void fireDraggables (bool write_repr, bool scale_radial = false, bool merging_focus = false);
};