From 5b3ed01dbaa86945e071db4103f39c5fe4b2f691 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 4 Feb 2011 06:48:16 +0100 Subject: Fix a snap bug in which the snapped to the help path instead of the real path (bzr r10032) --- src/object-snapper.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/object-snapper.cpp') 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 -- cgit v1.2.3