From 71563835c7943ea987a5d967b79ec90cb2b3c26e Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 12 Jun 2017 14:39:03 +0200 Subject: [PATCH] Avoid rounding issue when painting selection This is the same issue that was addressed in the all_sel case at 695b0cc3. The rounding issue only happens at specific zoom and jusification values. Fixes part of #8883. --- src/RowPainter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index 91dfb63e4d..55155716be 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -640,8 +640,9 @@ void RowPainter::paintSelection() const double x2 = e.pos2x(to); if (x1 > x2) swap(x1, x2); - pi_.pain.fillRectangle(int(x + x1), y1, int(x2 - x1), y2 - y1, - Color_selection); + // the 3rd argument is written like that to avoid rounding issues + pi_.pain.fillRectangle(int(x + x1), y1, int(x2 + x) - int(x1 + x), + y2 - y1, Color_selection); } x += e.full_width(); } -- 2.39.2