summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 18760d2)
raw | patch | inline | side by side (parent: 18760d2)
author | johncoswell <johncoswell@users.sourceforge.net> | |
Fri, 2 Mar 2007 03:00:25 +0000 (03:00 +0000) | ||
committer | johncoswell <johncoswell@users.sourceforge.net> | |
Fri, 2 Mar 2007 03:00:25 +0000 (03:00 +0000) |
src/flood-context.cpp | patch | blob | history |
diff --git a/src/flood-context.cpp b/src/flood-context.cpp
index fc6628f461d7b61bcba55b900c71c512eca4c84d..f58f70940e79d2e03f4aeb9566356bf5f3579c30 100644 (file)
--- a/src/flood-context.cpp
+++ b/src/flood-context.cpp
@@ -421,6 +421,8 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
int tolerance = (255 * prefs_get_int_attribute_limited("tools.paintbucket", "tolerance", 1, 0, 100)) / 100;
+ bool reached_screen_boundary = false;
+
while (!fill_queue.empty() && !aborted) {
NR::Point cp = fill_queue.front();
fill_queue.pop();
@@ -439,12 +441,20 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
if (y > 0) {
top_fill = try_add_to_queue(&fill_queue, px, trace_px, orig_color, x, y - 1, width, tolerance, top_fill);
} else {
- aborted = true; break;
+ if (bbox.min()[NR::Y] > screen.min()[NR::Y]) {
+ aborted = true; break;
+ } else {
+ reached_screen_boundary = true;
+ }
}
if (y < y_limit) {
bottom_fill = try_add_to_queue(&fill_queue, px, trace_px, orig_color, x, y + 1, width, tolerance, bottom_fill);
} else {
- aborted = true; break;
+ if (bbox.max()[NR::Y] < screen.max()[NR::Y]) {
+ aborted = true; break;
+ } else {
+ reached_screen_boundary = true;
+ }
}
bool default_top_fill = top_fill;
@@ -467,7 +477,11 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
left--; ok = true;
}
} else {
- aborted = true; break;
+ if (bbox.min()[NR::X] > screen.min()[NR::X]) {
+ aborted = true; break;
+ } else {
+ reached_screen_boundary = true;
+ }
}
} while (ok);
@@ -488,7 +502,11 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
right++; ok = true;
}
} else {
- aborted = true; break;
+ if (bbox.max()[NR::X] < screen.max()[NR::X]) {
+ aborted = true; break;
+ } else {
+ reached_screen_boundary = true;
+ }
}
} while (ok);
}
@@ -502,6 +520,10 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
return;
}
+ if (reached_screen_boundary) {
+ desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("<b>Only the visible part of the bounded area was filled.</b> If you want to fill all of the area, undo, zoom out, and fill again."));
+ }
+
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(trace_px,
GDK_COLORSPACE_RGB,
TRUE,