From 72bf152735b4d10db506f1c9a20889f640247005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6fferlein?= Date: Sun, 13 Feb 2022 10:06:01 +0100 Subject: [PATCH] Fixed painting of rulers and grids in the presence of oversampling. Now the ruler/grid do not change with oversampling. (#1007) --- src/laybasic/laybasic/layGridNet.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/laybasic/laybasic/layGridNet.cc b/src/laybasic/laybasic/layGridNet.cc index 96d420906..31f0dca4f 100644 --- a/src/laybasic/laybasic/layGridNet.cc +++ b/src/laybasic/laybasic/layGridNet.cc @@ -473,7 +473,7 @@ GridNet::render_bg (const lay::Viewport &vp, ViewObjectCanvas &canvas) // compute major grid and switch to secondary style if necessary int s = 0; - while (dgrid < fw * 4 / bmp_canvas->resolution ()) { + while (dgrid < fw * 4) { if (s == 0) { dgrid *= 2.0; } else if (s == 1) { @@ -502,9 +502,9 @@ GridNet::render_bg (const lay::Viewport &vp, ViewObjectCanvas &canvas) if (m_show_ruler && dgrid < vp.width () * 0.2) { - int rh = int (floor (0.5 + fw * 0.8 / bmp_canvas->resolution ())); - int xoffset = int (floor (0.5 + fw * 2.5 / bmp_canvas->resolution ())); - int yoffset = int (floor (0.5 + fw * 2.5 / bmp_canvas->resolution ())); + int rh = int (floor (0.5 + fw * 0.8)); + int xoffset = int (floor (0.5 + fw * 2.5)); + int yoffset = int (floor (0.5 + fw * 2.5)); painter.fill_rect (QPoint (xoffset, vp.height () - yoffset - rh / 2), QPoint (xoffset + int (floor (0.5 + dgrid)), vp.height () - yoffset + rh / 2),