summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/flood-tool.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2019-04-30 20:40:33 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2019-04-30 20:40:33 +0000
commitd137944b06575b9e79d0a3e79a3e5f5b8f6665e2 (patch)
tree6017a86cc0040ca9d7615c879036bd320f6e5de7 /src/ui/tools/flood-tool.cpp
parentFix disappearing and antialiasing of grid lines (diff)
parentSet spacing in About Dialog (diff)
downloadinkscape-d137944b06575b9e79d0a3e79a3e5f5b8f6665e2.tar.gz
inkscape-d137944b06575b9e79d0a3e79a3e5f5b8f6665e2.zip
Merge branch 'master' of gitlab.com:inkscape/inkscape
Diffstat (limited to 'src/ui/tools/flood-tool.cpp')
-rw-r--r--src/ui/tools/flood-tool.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp
index 6db530917..68987dfcc 100644
--- a/src/ui/tools/flood-tool.cpp
+++ b/src/ui/tools/flood-tool.cpp
@@ -627,7 +627,7 @@ static ScanlineCheckResult perform_bitmap_scanline_check(std::deque<Geom::Point>
bool can_paint_top = (top_ty > 0);
bool can_paint_bottom = (bottom_ty < bci.height);
- Geom::Point t = fill_queue->front();
+ Geom::Point front_of_queue = fill_queue->empty() ? Geom::Point() : fill_queue->front();
do {
ok = false;
@@ -645,8 +645,11 @@ static ScanlineCheckResult perform_bitmap_scanline_check(std::deque<Geom::Point>
paint_directions = paint_pixel(px, trace_px, orig_color, bci, current_trace_t);
if (bci.radius == 0) {
mark_pixel_checked(current_trace_t);
- if ((t[Geom::X] == bci.x) && (t[Geom::Y] == bci.y)) {
- fill_queue->pop_front(); t = fill_queue->front();
+ if ((!fill_queue->empty()) &&
+ (front_of_queue[Geom::X] == bci.x) &&
+ (front_of_queue[Geom::Y] == bci.y)) {
+ fill_queue->pop_front();
+ front_of_queue = fill_queue->empty() ? Geom::Point() : fill_queue->front();
}
}