summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-02-01 10:48:53 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-02-01 10:48:53 +0000
commit3581010e2f7021167ba0f4e577e0b3f8da2944b6 (patch)
treee6644dc31e58d21ff60a9ae7fe121287071e5566 /src/display
parentCreate a empty LPE (diff)
parentLatvian translation update (diff)
downloadinkscape-3581010e2f7021167ba0f4e577e0b3f8da2944b6.tar.gz
inkscape-3581010e2f7021167ba0f4e577e0b3f8da2944b6.zip
Effect done
(bzr r13879.1.2)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/canvas-axonomgrid.cpp5
-rw-r--r--src/display/canvas-grid.cpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp
index 05ba71a49..ac93f5c88 100644
--- a/src/display/canvas-axonomgrid.cpp
+++ b/src/display/canvas-axonomgrid.cpp
@@ -220,6 +220,11 @@ CanvasAxonomGrid::readRepr()
if( root->viewBox_set ) {
scale_x = root->width.computed / root->viewBox.width();
scale_y = root->height.computed / root->viewBox.height();
+ if (Geom::are_near(scale_x / scale_y, 1.0, Geom::EPSILON)) {
+ // scaling is uniform, try to reduce numerical error
+ scale_x = (scale_x + scale_y)/2.0;
+ scale_y = scale_x;
+ }
}
gchar const *value;
diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp
index 1a284b46e..0a43ed8b7 100644
--- a/src/display/canvas-grid.cpp
+++ b/src/display/canvas-grid.cpp
@@ -544,6 +544,11 @@ CanvasXYGrid::readRepr()
if( root->viewBox_set ) {
scale_x = root->width.computed / root->viewBox.width();
scale_y = root->height.computed / root->viewBox.height();
+ if (Geom::are_near(scale_x / scale_y, 1.0, Geom::EPSILON)) {
+ // scaling is uniform, try to reduce numerical error
+ scale_x = (scale_x + scale_y)/2.0;
+ scale_y = scale_x;
+ }
}
gchar const *value;