From 7244765fed5f43e5b36bd6fc979f06b0e49653c4 Mon Sep 17 00:00:00 2001 From: johncoswell Date: Sun, 15 Apr 2007 12:23:46 +0000 Subject: [PATCH] Fix retrieving of initial point color for paint bucket fill --- src/flood-context.cpp | 10 ++++++---- 1 file 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; -- 2.30.2