فهرست منبع

LibGfx: Return early from Painter::draw_line() if clip rect is empty

Andreas Kling 2 سال پیش
والد
کامیت
57404bae1f
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      Userland/Libraries/LibGfx/Painter.cpp

+ 3 - 0
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;