From 57404bae1f67fbdec1934ac41a20d59668450909 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 26 Jun 2023 08:05:12 +0200 Subject: [PATCH] LibGfx: Return early from Painter::draw_line() if clip rect is empty --- Userland/Libraries/LibGfx/Painter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index 3eb84baee4..f0c4c10454 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -2000,6 +2000,9 @@ void Painter::draw_physical_pixel(IntPoint physical_position, Color color, int t void Painter::draw_line(IntPoint a_p1, IntPoint a_p2, Color color, int thickness, LineStyle style, Color alternate_color) { + if (clip_rect().is_empty()) + return; + if (thickness <= 0) return;