From a1119ae6ae31ca572fc9090d21176b5b30fd6037 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Wed, 4 Feb 2015 14:42:47 -0500 Subject: for grid spacing, reduce numerical error if viewbox and page are same size (bzr r13900) --- src/display/canvas-grid.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/display/canvas-grid.cpp') 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; } } -- cgit v1.2.3