Michael Buschbeck opened merge request !2273: Fix grid and guide display at high zoom at Inkscape / inkscape

Michael Buschbeck
2020-08-30T14:56:46Z

Change hard-coded finite dimensions of nominally infinite bounds in various places to be actually infinite. At high zoom levels when far from the coordinate origin, the old hard-coded values (of 1,000,000 units) weren't enough.

Replace implicit double-to-int conversion for canvas redraw area with a principled overload that gracefully handles value overflow during this conversion. (Overflow is undefined behavior otherwise, and specifically in this case converted +inf to -2^31, oddly enough.)

Together, these changes fix the following two issues:

Far from the coordinate origin, the grid failed to render even at moderate zoom levels. (Now it renders at any zoom level, even maximum zoom.)

Under similar circumstances, guides failed to be rendered while being dragged. (They did render when dropped.) Only the guide origin was rendered during drag.

Resolves: #1817