From 7860d701fd23d8e5f03086c249d30759732f07fd Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 20 Feb 2009 21:49:07 +0000 Subject: The snap indicator's tooltip now displays "A to B", whereas before it only displayed "B". (bzr r7335) --- src/sp-image.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/sp-image.cpp') 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)); } } -- cgit v1.2.3