summaryrefslogtreecommitdiffstats
path: root/src/seltrans.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-08-11 06:43:24 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-08-11 06:43:24 +0000
commit19117c36082531a00df461260f917d1207edde1f (patch)
tree4670bf8aef55b561c790e6498e8ad88592a83d75 /src/seltrans.cpp
parentImplement constrained snapping to nodes (diff)
downloadinkscape-19117c36082531a00df461260f917d1207edde1f.tar.gz
inkscape-19117c36082531a00df461260f917d1207edde1f.zip
Clear pointers in the snapmanager if they're no longer needed.
(bzr r9697)
Diffstat (limited to 'src/seltrans.cpp')
-rw-r--r--src/seltrans.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 764c222a8..7dbeb4173 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -1039,6 +1039,7 @@ gboolean Inkscape::SelTrans::scaleRequest(Geom::Point &pt, guint state)
geom_scale = Geom::Scale(sn.getTransformation());
pt = _calcAbsAffineGeom(geom_scale);
}
+ m.unSetup();
}
/* Status text */
@@ -1134,6 +1135,8 @@ gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, Geom
// will have to calculate pt taking the stroke width into account
pt = _calcAbsAffineGeom(geom_scale);
}
+
+ m.unSetup();
}
// status text
@@ -1226,6 +1229,8 @@ gboolean Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, Geom::P
} else {
_desktop->snapindicator->remove_snaptarget();
}
+
+ m.unSetup();
}
// Update the handle position
@@ -1299,6 +1304,7 @@ gboolean Inkscape::SelTrans::rotateRequest(Geom::Point &pt, guint state)
m.setup(_desktop, false, _items_const);
// When rotating, we cannot snap the corners of the bounding box, see the comment in "constrainedSnapRotate" for details
Inkscape::SnappedPoint sn = m.constrainedSnapRotate(_snap_points, _point, radians, _origin);
+ m.unSetup();
if (sn.getSnapped()) {
_desktop->snapindicator->set_new_snaptarget(sn);
@@ -1309,6 +1315,7 @@ gboolean Inkscape::SelTrans::rotateRequest(Geom::Point &pt, guint state)
} else {
_desktop->snapindicator->remove_snaptarget();
}
+
}
@@ -1331,9 +1338,6 @@ gboolean Inkscape::SelTrans::rotateRequest(Geom::Point &pt, guint state)
// Move the item's transformation center
gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state)
{
- SnapManager &m = _desktop->namedview->snap_manager;
- m.setup(_desktop);
-
// Center is being dragged for the first item in the selection only
// Find out which item is first ...
GSList *items = (GSList *) const_cast<Selection *>(_selection)->itemList();
@@ -1343,8 +1347,11 @@ gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state)
}
// ... and store that item because later on we need to make sure that
// this transformation center won't snap to itself
+ SnapManager &m = _desktop->namedview->snap_manager;
+ m.setup(_desktop);
m.setRotationCenterSource(first);
m.freeSnapReturnByRef(pt, Inkscape::SNAPSOURCE_ROTATION_CENTER);
+ m.unSetup();
if (state & GDK_CONTROL_MASK) {
if ( fabs(_point[Geom::X] - pt[Geom::X]) > fabs(_point[Geom::Y] - pt[Geom::Y]) ) {
@@ -1439,6 +1446,7 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state)
}
m.setup(_desktop, true, _items_const);
dxy = m.multipleOfGridPitch(dxy, _point);
+ m.unSetup();
} else if (shift) {
if (control) { // shift & control: constrained movement without snapping
if (fabs(dxy[Geom::X]) > fabs(dxy[Geom::Y])) {
@@ -1493,6 +1501,7 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state)
double elapsed = ((((double)endtime.tv_sec - starttime.tv_sec) * G_USEC_PER_SEC + (endtime.tv_usec - starttime.tv_usec))) / 1000.0;
std::cout << "Time spent snapping: " << elapsed << std::endl; */
}
+ m.unSetup();
/* Pick one */
Inkscape::SnappedPoint best_snapped_point;