diff --git a/repos/gems/include/polygon_gfx/line_painter.h b/repos/gems/include/polygon_gfx/line_painter.h index 65df7f621a..fed44197a3 100644 --- a/repos/gems/include/polygon_gfx/line_painter.h +++ b/repos/gems/include/polygon_gfx/line_painter.h @@ -128,9 +128,12 @@ struct Line_painter */ Rect const clip(surface.clip().p1(), surface.clip().p2() + Point(-1, -1)); + if (!clip.valid()) + return; + /* both points must reside within clipping area */ - if (!surface.clip().contains(Point(x1.integer(), y1.integer())) || - !surface.clip().contains(Point(x2.integer(), y2.integer()))) + if (!clip.contains(Point(x1.integer(), y1.integer())) || + !clip.contains(Point(x2.integer(), y2.integer()))) return; long const dx_f = x2.value - x1.value,