diff options
| author | John Bintz <me@johnbintz.com> | 2007-04-15 12:23:46 +0000 |
|---|---|---|
| committer | johncoswell <johncoswell@users.sourceforge.net> | 2007-04-15 12:23:46 +0000 |
| commit | 8ceada5af3241226668ae8c23cdcd041cf67aa4f (patch) | |
| tree | 5a244ca4fb31a9b31e68e60aeb40b92961ecbfe0 /src/flood-context.cpp | |
| parent | Add ability to drag cursor while holding alt to add multiple points to paint ... (diff) | |
| download | inkscape-8ceada5af3241226668ae8c23cdcd041cf67aa4f.tar.gz inkscape-8ceada5af3241226668ae8c23cdcd041cf67aa4f.zip | |
Fix retrieving of initial point color for paint bucket fill
(bzr r2901)
Diffstat (limited to 'src/flood-context.cpp')
| -rw-r--r-- | src/flood-context.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/flood-context.cpp b/src/flood-context.cpp index 7e9ef41da..8a9502843 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -610,10 +610,6 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even points.push_back(NR::Point(event->button.x, event->button.y)); } - unsigned char *orig_px = get_pixel(px, (int)points[0][NR::X], (int)points[0][NR::Y], width); - unsigned char orig_color[4]; - for (int i = 0; i < 4; i++) { orig_color[i] = orig_px[i]; } - for (unsigned int i = 0; i < points.size(); i++) { NR::Point pw = NR::Point(points[i][NR::X] / zoom_scale, sp_document_height(document) + (points[i][NR::Y] / zoom_scale)) * affine; @@ -622,6 +618,12 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even fill_queue.push(pw); } + + NR::Point first_point = NR::Point(points[0][NR::X] / zoom_scale, sp_document_height(document) + (points[0][NR::Y] / zoom_scale)) * affine; + + unsigned char *orig_px = get_pixel(px, (int)first_point[NR::X], (int)first_point[NR::Y], width); + unsigned char orig_color[4]; + for (int i = 0; i < 4; i++) { orig_color[i] = orig_px[i]; } bool aborted = false; int y_limit = height - 1; |
