gems: fix clipping in polygon_gfx/line_painter.h

This clipping check happened to wrongly test the surface's clipping area
instead of the by 1x1 pixel reduced 'clip' rectangle.
This commit is contained in:
Norman Feske 2022-09-15 16:35:22 +02:00 committed by Christian Helmuth
parent 0ff755b236
commit c0e303632e

View File

@ -128,9 +128,12 @@ struct Line_painter
*/ */
Rect const clip(surface.clip().p1(), surface.clip().p2() + Point(-1, -1)); Rect const clip(surface.clip().p1(), surface.clip().p2() + Point(-1, -1));
if (!clip.valid())
return;
/* both points must reside within clipping area */ /* both points must reside within clipping area */
if (!surface.clip().contains(Point(x1.integer(), y1.integer())) || if (!clip.contains(Point(x1.integer(), y1.integer())) ||
!surface.clip().contains(Point(x2.integer(), y2.integer()))) !clip.contains(Point(x2.integer(), y2.integer())))
return; return;
long const dx_f = x2.value - x1.value, long const dx_f = x2.value - x1.value,