فهرست منبع

PaintBrush: Flood filling with the same color is a no-op.

Andreas Kling 6 سال پیش
والد
کامیت
264890bfc3
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      Applications/PaintBrush/BucketTool.cpp

+ 3 - 0
Applications/PaintBrush/BucketTool.cpp

@@ -18,6 +18,9 @@ static void flood_fill(GraphicsBitmap& bitmap, const Point& start_position, Colo
 {
     ASSERT(bitmap.format() == GraphicsBitmap::Format::RGB32);
 
+    if (target_color == fill_color)
+        return;
+
     Queue<Point> queue;
     queue.enqueue(Point(start_position));
     while (!queue.is_empty()) {