From 04a8f1d3d2dc8bb694f79192cb8ebaecb5a51961 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 21 Jun 2022 19:21:50 +0200 Subject: [PATCH] Fix BucketAction. --- modules/paint/actions/bucket_action.cpp | 2 +- modules/paint/paint_canvas.cpp | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/paint/actions/bucket_action.cpp b/modules/paint/actions/bucket_action.cpp index f76d5ea07..27f728f64 100644 --- a/modules/paint/actions/bucket_action.cpp +++ b/modules/paint/actions/bucket_action.cpp @@ -49,7 +49,7 @@ void BucketAction::do_action(PaintCanvas *canvas, const Array &data) { continue; } - if (canvas->is_alpha_locked() && col.a < 0.00001) { + if (canvas->is_alpha_locked() && col.a < 0.0001) { continue; } diff --git a/modules/paint/paint_canvas.cpp b/modules/paint/paint_canvas.cpp index 169794d5b..d3d7f965a 100644 --- a/modules/paint/paint_canvas.cpp +++ b/modules/paint/paint_canvas.cpp @@ -476,17 +476,7 @@ PoolVector2iArray PaintCanvas::get_neighbouring_pixels(const int pos_x, const in to_check_queue.remove(0); Vector2i p = PaintUtilities::to_2D(idx, _canvas_width); - bool found = false; - PoolIntArray::Read r = checked_queue.read(); - for (int i = 0; i < checked_queue.size(); ++i) { - if (r[i] == idx) { - found = true; - break; - } - } - r.release(); - - if (!found) { + if (checked_queue.contains(idx)) { continue; }