summaryrefslogtreecommitdiffstats
path: root/src/sp-star.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-02-20 21:49:07 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-02-20 21:49:07 +0000
commit7860d701fd23d8e5f03086c249d30759732f07fd (patch)
treec3b8f351366407783eb5c96ba4fcdbbc7a132da9 /src/sp-star.cpp
parentSome filters and extensions updates (diff)
downloadinkscape-7860d701fd23d8e5f03086c249d30759732f07fd.tar.gz
inkscape-7860d701fd23d8e5f03086c249d30759732f07fd.zip
The snap indicator's tooltip now displays "A to B", whereas before it only displayed "B".
(bzr r7335)
Diffstat (limited to 'src/sp-star.cpp')
-rw-r--r--src/sp-star.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index c1581a6d6..3c8754a11 100644
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
@@ -39,7 +39,7 @@ static void sp_star_set (SPObject *object, unsigned int key, const gchar *value)
static void sp_star_update (SPObject *object, SPCtx *ctx, guint flags);
static gchar * sp_star_description (SPItem * item);
-static void sp_star_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs);
+static void sp_star_snappoints(SPItem const *item, bool const target, SnapPointsWithType &p, Inkscape::SnapPreferences const *snapprefs);
static void sp_star_set_shape (SPShape *shape);
static void sp_star_update_patheffect (SPLPEItem *lpeitem, bool write);
@@ -528,7 +528,7 @@ sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1,
SP_OBJECT(star)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
}
-static void sp_star_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs)
+static void sp_star_snappoints(SPItem const *item, bool const target, SnapPointsWithType &p, Inkscape::SnapPreferences const *snapprefs)
{
// We will determine the star's midpoint ourselves, instead of trusting on the base class
// Therefore setSnapObjectMidpoints() is set to false temporarily
@@ -536,7 +536,7 @@ static void sp_star_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::S
local_snapprefs.setSnapObjectMidpoints(false);
if (((SPItemClass *) parent_class)->snappoints) {
- ((SPItemClass *) parent_class)->snappoints (item, p, &local_snapprefs);
+ ((SPItemClass *) parent_class)->snappoints (item, target, p, &local_snapprefs);
}
// Help enforcing strict snapping, i.e. only return nodes when we're snapping nodes to nodes or a guide to nodes
@@ -546,7 +546,8 @@ static void sp_star_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::S
if (snapprefs->getSnapObjectMidpoints()) {
Geom::Matrix const i2d (sp_item_i2d_affine (item));
- *p = SP_STAR(item)->center * i2d;
+ int type = target ? int(Inkscape::SNAPTARGET_OBJECT_MIDPOINT) : int(Inkscape::SNAPSOURCE_OBJECT_MIDPOINT);
+ p.push_back(std::make_pair(SP_STAR(item)->center * i2d, type));
}
}