summaryrefslogtreecommitdiffstats
path: root/src/object-snapper.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2011-02-04 05:48:16 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2011-02-04 05:48:16 +0000
commit5b3ed01dbaa86945e071db4103f39c5fe4b2f691 (patch)
treea66caded7f7b4245cbdf702632ab725cb0230729 /src/object-snapper.cpp
parentFix Linux build after 2Geom update (diff)
downloadinkscape-5b3ed01dbaa86945e071db4103f39c5fe4b2f691.tar.gz
inkscape-5b3ed01dbaa86945e071db4103f39c5fe4b2f691.zip
Fix a snap bug in which the snapped to the help path instead of the real path
(bzr r10032)
Diffstat (limited to 'src/object-snapper.cpp')
-rw-r--r--src/object-snapper.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index e123173a5..1e2f71c95 100644
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -414,8 +414,13 @@ void Inkscape::ObjectSnapper::_collectPaths(Geom::Point /*p*/,
very_complex_path = sp_nodes_in_path(SP_PATH(root_item)) > 500;
}
- if (!very_lenghty_prose && !very_complex_path) {
- SPCurve *curve = curve_for_item(root_item);
+ if (!very_lenghty_prose && !very_complex_path && root_item) {
+ SPCurve *curve = NULL;
+ if (SP_IS_SHAPE(root_item)) {
+ curve = SP_SHAPE(root_item)->getCurve();
+ } else if (SP_IS_TEXT(root_item) || SP_IS_FLOWTEXT(root_item)) {
+ curve = te_get_layout(root_item)->convertToCurves();
+ }
if (curve) {
// We will get our own copy of the pathvector, which must be freed at some point