summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-07-01 21:21:58 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-07-01 21:21:58 +0000
commit4bee400f3d7b314c3930b450e6715dfe48a33412 (patch)
tree735ce86890ef65083b7d2df234724a51104fcf81 /src
parentMinor fixes in Dutch translation (diff)
downloadinkscape-4bee400f3d7b314c3930b450e6715dfe48a33412.tar.gz
inkscape-4bee400f3d7b314c3930b450e6715dfe48a33412.zip
fix Launchpad bug 593023: crash in constrained snap due to not calling setup() before snapping
Fixed bugs: - https://launchpad.net/bugs/593023 (bzr r9550)
Diffstat (limited to 'src')
-rw-r--r--src/gradient-drag.cpp3
-rw-r--r--src/object-snapper.cpp7
2 files changed, 8 insertions, 2 deletions
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 227a5f003..c9a982e42 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -809,9 +809,10 @@ gr_knot_moved_midpoint_handler(SPKnot */*knot*/, Geom::Point const &ppointer, gu
} else {
p = snap_vector_midpoint (p, low_lim, high_lim, 0);
if (!(state & GDK_SHIFT_MASK)) {
+ Inkscape::Snapper::ConstraintLine cl(low_lim, high_lim - low_lim);
SPDesktop *desktop = dragger->parent->desktop;
SnapManager &m = desktop->namedview->snap_manager;
- Inkscape::Snapper::ConstraintLine cl(low_lim, high_lim - low_lim);
+ m.setup(desktop);
m.constrainedSnapReturnByRef(p, Inkscape::SNAPSOURCE_OTHER_HANDLE, cl);
}
}
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index bced0ac44..983a6fede 100644
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -91,6 +91,12 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent,
return;
}
+ if (_snapmanager->getDesktop() == NULL) {
+ g_warning("desktop == NULL, so we cannot snap; please inform the developpers of this bug");
+ // Apparently the etup() method from the SnapManager class hasn't been called before trying to snap.
+ }
+
+
if (first_point) {
_candidates->clear();
}
@@ -99,7 +105,6 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent,
bbox_to_snap_incl.expandBy(getSnapperTolerance()); // see?
for (SPObject* o = sp_object_first_child(parent); o != NULL; o = SP_OBJECT_NEXT(o)) {
- g_assert(_snapmanager->getDesktop() != NULL);
if (SP_IS_ITEM(o) && !(_snapmanager->getDesktop()->itemIsHidden(SP_ITEM(o)) && !clip_or_mask)) {
// Snapping to items in a locked layer is allowed
// Don't snap to hidden objects, unless they're a clipped path or a mask