From 264890bfc3645b044b09e5b908ec60bbd678992c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 16 Jun 2019 06:34:29 +0200 Subject: [PATCH] PaintBrush: Flood filling with the same color is a no-op. --- Applications/PaintBrush/BucketTool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Applications/PaintBrush/BucketTool.cpp b/Applications/PaintBrush/BucketTool.cpp index c2b6353418..70ae32dde1 100644 --- a/Applications/PaintBrush/BucketTool.cpp +++ b/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 queue; queue.enqueue(Point(start_position)); while (!queue.is_empty()) {