mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 02:35:20 +00:00
Avoid rounding issue when painting selection
This issue was already addressed in the all_sel case. It only happens
at specific zoom and jusification values.
Fixes part of #8883.
(cherry picked from commit 71563835c7
)
This commit is contained in:
parent
04efc84abc
commit
8fef81a373
@ -687,8 +687,9 @@ void RowPainter::paintSelection() const
|
|||||||
double x2 = e.pos2x(to);
|
double x2 = e.pos2x(to);
|
||||||
if (x1 > x2)
|
if (x1 > x2)
|
||||||
swap(x1, x2);
|
swap(x1, x2);
|
||||||
pi_.pain.fillRectangle(int(x + x1), y1, int(x2 - x1), y2 - y1,
|
// the 3rd argument is written like that to avoid rounding issues
|
||||||
Color_selection);
|
pi_.pain.fillRectangle(int(x + x1), y1, int(x2 + x) - int(x1 + x),
|
||||||
|
y2 - y1, Color_selection);
|
||||||
}
|
}
|
||||||
x += e.full_width();
|
x += e.full_width();
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,8 @@ What's new
|
|||||||
|
|
||||||
- Fix glacial performance with ancient Hebrew text on macOS.
|
- Fix glacial performance with ancient Hebrew text on macOS.
|
||||||
|
|
||||||
|
- Fix hole in selection for some zoom and justification values (bug 8883).
|
||||||
|
|
||||||
- Fix potential crash when cursor enters an inset (bug 10691).
|
- Fix potential crash when cursor enters an inset (bug 10691).
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user