summaryrefslogtreecommitdiffstats
path: root/src/sp-image.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-01-14 08:13:09 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-01-14 08:13:09 +0000
commit7f7da4643d6909af5cd58b2f24846774e3af509b (patch)
tree1fec13b3616ecc90fb251bb9e643aefc43c80c43 /src/sp-image.cpp
parentSome additional docs (diff)
parentInitial cut of disabling floating windows on window managers with problems. (diff)
downloadinkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.tar.gz
inkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.zip
* Merge from trunk
* Update to new snapping API * Modify the join action slightly (bzr r8846.2.11)
Diffstat (limited to 'src/sp-image.cpp')
-rw-r--r--src/sp-image.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index 65aad1e2d..daf5e9e88 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -44,7 +44,7 @@
#include <glibmm/i18n.h>
#include "xml/quote.h"
#include <xml/repr.h>
-
+#include "snap-candidate.h"
#include "libnr/nr-matrix-fns.h"
#include "io/sys.h"
@@ -53,6 +53,13 @@
#include "color-profile.h"
//#define DEBUG_LCMS
#ifdef DEBUG_LCMS
+
+
+#define DEBUG_MESSAGE(key, ...)\
+{\
+ g_message( __VA_ARGS__ );\
+}
+
#include "preferences.h"
#include <gtk/gtkmessagedialog.h>
#endif // DEBUG_LCMS
@@ -79,7 +86,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, bool const target, SnapPointsWithType &p, Inkscape::SnapPreferences const *snapprefs);
+static void sp_image_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &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);
@@ -105,7 +112,7 @@ extern "C"
#ifdef DEBUG_LCMS
extern guint update_in_progress;
-#define DEBUG_MESSAGE(key, ...) \
+#define DEBUG_MESSAGE_SCISLAC(key, ...) \
{\
Inkscape::Preferences *prefs = Inkscape::Preferences::get();\
bool dump = prefs->getBool("/options/scislac/" #key);\
@@ -1325,7 +1332,7 @@ sp_image_update_canvas_image (SPImage *image)
}
}
-static void sp_image_snappoints(SPItem const *item, bool const target, SnapPointsWithType &p, Inkscape::SnapPreferences const */*snapprefs*/)
+static void sp_image_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &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
@@ -1347,12 +1354,10 @@ static void sp_image_snappoints(SPItem const *item, bool const target, SnapPoint
double const x1 = x0 + image.width.computed;
double const y1 = y0 + image.height.computed;
Geom::Matrix const i2d (sp_item_i2d_affine (item));
- Geom::Point pt;
- int type = target ? int(Inkscape::SNAPTARGET_CORNER) : int(Inkscape::SNAPSOURCE_CORNER);
- 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));
+ p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(x0, y0) * i2d, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER));
+ p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(x0, y1) * i2d, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER));
+ p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(x1, y1) * i2d, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER));
+ p.push_back(Inkscape::SnapCandidatePoint(Geom::Point(x1, y0) * i2d, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER));
}
}