summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2011-07-15 22:51:02 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2011-07-15 22:51:02 +0000
commitf412e210814555e34cd2a6d1bb86cd2c153d60a0 (patch)
tree61c0b2bfc5028821973f82a48e951e2221b4c79f /src
parentDutch translation update (diff)
downloadinkscape-f412e210814555e34cd2a6d1bb86cd2c153d60a0.tar.gz
inkscape-f412e210814555e34cd2a6d1bb86cd2c153d60a0.zip
Fix scaling error when snapping, caused by rev. #10326
Fixed bugs: - https://launchpad.net/bugs/808558 (bzr r10458)
Diffstat (limited to 'src')
-rw-r--r--src/snap.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 3e79a221e..d556a751a 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -746,6 +746,7 @@ Inkscape::SnappedPoint SnapManager::_snapTransformed(
// std::cout << std::endl;
bool first_free_snap = true;
+
for (std::vector<Inkscape::SnapCandidatePoint>::const_iterator i = points.begin(); i != points.end(); i++) {
/* Snap it */
@@ -850,6 +851,7 @@ Inkscape::SnappedPoint SnapManager::_snapTransformed(
result[0] = result[1];
}
}
+
// Compare the resulting scaling with the desired scaling
Geom::Point scale_metric = Geom::abs(result - transformation); // One or both of its components might be NR_HUGE
if (scale_metric[0] == NR_HUGE || scale_metric[1] == NR_HUGE) {
@@ -930,10 +932,10 @@ Inkscape::SnappedPoint SnapManager::_snapTransformed(
Geom::Coord best_metric;
if (transformation_type == SCALE) {
- // When scaling, don't ever exit with one of scaling components set to Geom::infinity()
+ // When scaling, don't ever exit with one of scaling components uninitialized
for (int index = 0; index < 2; index++) {
- if (best_transformation[index] == Geom::infinity()) {
- if (uniform && best_transformation[1-index] < Geom::infinity()) {
+ if (fabs(best_transformation[index]) >= 1e12) {
+ if (uniform && fabs(best_transformation[1-index]) < 1e12) {
best_transformation[index] = best_transformation[1-index];
} else {
best_transformation[index] = transformation[index];