summaryrefslogtreecommitdiffstats
path: root/src/display/canvas-grid.cpp
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2015-02-04 19:42:47 +0000
committerapenner <penner@vaxxine.com>2015-02-04 19:42:47 +0000
commita1119ae6ae31ca572fc9090d21176b5b30fd6037 (patch)
tree09997bfbef8c4e8cf5b532e2b83c6ef4e57a0c12 /src/display/canvas-grid.cpp
parentReplace Catmull-Rom by fininte-differences in smoothing routines. (diff)
downloadinkscape-a1119ae6ae31ca572fc9090d21176b5b30fd6037.tar.gz
inkscape-a1119ae6ae31ca572fc9090d21176b5b30fd6037.zip
for grid spacing, reduce numerical error if viewbox and page are same size
(bzr r13900)
Diffstat (limited to 'src/display/canvas-grid.cpp')
-rw-r--r--src/display/canvas-grid.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp
index 0a43ed8b7..0f58096ce 100644
--- a/src/display/canvas-grid.cpp
+++ b/src/display/canvas-grid.cpp
@@ -547,6 +547,9 @@ CanvasXYGrid::readRepr()
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;
+ double scale_none = Inkscape::Util::Quantity::convert(1, doc->getDisplayUnit(), "px");
+ if (Geom::are_near(scale_x / scale_none, 1.0, Geom::EPSILON))
+ scale_x = scale_none; // objects are same size, reduce numerical error
scale_y = scale_x;
}
}