summaryrefslogtreecommitdiffstats
path: root/src/sp-image.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-image.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-image.cpp')
-rw-r--r--src/sp-image.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index 75be3bea2..e23dddaf6 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -76,7 +76,7 @@ static Inkscape::XML::Node *sp_image_write (SPObject *object, Inkscape::XML::Doc
static void sp_image_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
static void sp_image_print (SPItem * item, SPPrintContext *ctx);
static gchar * sp_image_description (SPItem * item);
-static void sp_image_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs);
+static void sp_image_snappoints(SPItem const *item, bool const target, SnapPointsWithType &p, Inkscape::SnapPreferences const *snapprefs);
static NRArenaItem *sp_image_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
static Geom::Matrix sp_image_set_transform (SPItem *item, Geom::Matrix const &xform);
static void sp_image_set_curve(SPImage *image);
@@ -1305,7 +1305,7 @@ sp_image_update_canvas_image (SPImage *image)
}
}
-static void sp_image_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const */*snapprefs*/)
+static void sp_image_snappoints(SPItem const *item, bool const target, SnapPointsWithType &p, Inkscape::SnapPreferences const */*snapprefs*/)
{
/* An image doesn't have any nodes to snap, but still we want to be able snap one image
to another. Therefore we will create some snappoints at the corner, similar to a rect. If
@@ -1327,10 +1327,12 @@ static void sp_image_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::
double const x1 = x0 + image.width.computed;
double const y1 = y0 + image.height.computed;
Geom::Matrix const i2d (sp_item_i2d_affine (item));
- *p = Geom::Point(x0, y0) * i2d;
- *p = Geom::Point(x0, y1) * i2d;
- *p = Geom::Point(x1, y1) * i2d;
- *p = Geom::Point(x1, y0) * i2d;
+ Geom::Point pt;
+ int type = target ? int(Inkscape::SNAPTARGET_HANDLE) : int(Inkscape::SNAPSOURCE_HANDLE);
+ p.push_back(std::make_pair(Geom::Point(x0, y0) * i2d, type));
+ p.push_back(std::make_pair(Geom::Point(x0, y1) * i2d, type));
+ p.push_back(std::make_pair(Geom::Point(x1, y1) * i2d, type));
+ p.push_back(std::make_pair(Geom::Point(x1, y0) * i2d, type));
}
}