From 014489163050d8abe9e5c4949fb80f3c21b1c17b Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 13 Mar 2017 15:22:22 +0100 Subject: Replace rectangle based zooming by affine based zooming. This allows a rotation to be included in the drawing to window mapping. General code cleanup. Added documentation. Any change to zooming behavior is probably a bug. (bzr r15592) --- src/display/canvas-grid.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/display/canvas-grid.cpp') diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index cf7d04555..2dadde336 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -841,7 +841,9 @@ void CanvasXYGrid::Update (Geom::Affine const &affine, unsigned int /*flags*/) { ow = origin * affine; - sw = spacing * affine; + // Temp hack to insure grid doesn't collapse with rotation. + sw[0] = spacing[0] * sqrt(affine[0]*affine[0] + affine[1]*affine[1]); + sw[1] = spacing[1] * sqrt(affine[2]*affine[2] + affine[3]*affine[3]); sw -= Geom::Point(affine[4], affine[5]); for(int dim = 0; dim < 2; dim++) { -- cgit v1.2.3