Code

Fix tweak and paint bucket tools
authorKrzysztof Kosiński <tweenk.pl@gmail.com>
Sat, 3 Apr 2010 03:25:05 +0000 (05:25 +0200)
committerKrzysztof Kosiński <tweenk.pl@gmail.com>
Sat, 3 Apr 2010 03:25:05 +0000 (05:25 +0200)
src/flood-context.cpp
src/tweak-context.cpp

index 612ae1cfc6cbceef49f8b34e0b2b53d2d88cf6cb..910b5dd808d367cd6883db829f18128064b31061 100644 (file)
@@ -798,7 +798,7 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
     unsigned int height = (int)ceil(screen.height() * zoom_scale * padding);
 
     Geom::Point origin(screen.min()[Geom::X],
-                       sp_document_height(document) - screen.height() - screen.min()[Geom::Y]);
+                       screen.min()[Geom::Y]);
                     
     origin[Geom::X] = origin[Geom::X] + (screen.width() * ((1 - padding) / 2));
     origin[Geom::Y] = origin[Geom::Y] + (screen.height() * ((1 - padding) / 2));
@@ -905,7 +905,7 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
     }
 
     for (unsigned int i = 0; i < fill_points.size(); i++) {
-        Geom::Point pw = Geom::Point(fill_points[i][Geom::X] / zoom_scale, sp_document_height(document) + (fill_points[i][Geom::Y] / zoom_scale)) * affine;
+        Geom::Point pw = Geom::Point(fill_points[i][Geom::X] / zoom_scale, (fill_points[i][Geom::Y] / zoom_scale)) * affine;
 
         pw[Geom::X] = (int)MIN(width - 1, MAX(0, pw[Geom::X]));
         pw[Geom::Y] = (int)MIN(height - 1, MAX(0, pw[Geom::Y]));
index 13299b5a4004fef123cb90f05cc659879cd7ca24..a34a61f53cc05292f381283338a49b3a2585d584 100644 (file)
@@ -448,7 +448,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
                 if (a->contains(p)) x = 0;
                 if (x < 1) {
                     Geom::Point move = force * 0.5 * (cos(M_PI * x) + 1) * vector;
-                    sp_item_move_rel(item, Geom::Translate(move[Geom::X], -move[Geom::Y]));
+                    sp_item_move_rel(item, Geom::Translate(move[Geom::X], move[Geom::Y]));
                     did = true;
                 }
             }
@@ -462,7 +462,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
                 if (x < 1) {
                     Geom::Point move = force * 0.5 * (cos(M_PI * x) + 1) * 
                         (reverse? (a->midpoint() - p) : (p - a->midpoint()));
-                    sp_item_move_rel(item, Geom::Translate(move[Geom::X], -move[Geom::Y]));
+                    sp_item_move_rel(item, Geom::Translate(move[Geom::X], move[Geom::Y]));
                     did = true;
                 }
             }
@@ -477,7 +477,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
                 if (a->contains(p)) x = 0;
                 if (x < 1) {
                     Geom::Point move = force * 0.5 * (cos(M_PI * x) + 1) * Geom::Point(cos(dp)*dr, sin(dp)*dr);
-                    sp_item_move_rel(item, Geom::Translate(move[Geom::X], -move[Geom::Y]));
+                    sp_item_move_rel(item, Geom::Translate(move[Geom::X], move[Geom::Y]));
                     did = true;
                 }
             }
@@ -502,7 +502,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
                 double x = Geom::L2(a->midpoint() - p)/radius;
                 if (a->contains(p)) x = 0;
                 if (x < 1) {
-                    double angle = (reverse? force : -force) * 0.05 * (cos(M_PI * x) + 1) * M_PI;
+                    double angle = (reverse? -force : force) * 0.05 * (cos(M_PI * x) + 1) * M_PI;
                     sp_item_rotate_rel(item, Geom::Rotate(angle));
                     did = true;
                 }