[gimp/soc-2011-warp] warp-tool: temporary fix to update the preview with imagemap apply_region, not totally working



commit 3486193be04cc44afdaf7ec09a8b740110b108a4
Author: Michael Murà <batolettre gmail com>
Date:   Tue Jul 26 16:59:57 2011 +0200

    warp-tool: temporary fix to update the preview with imagemap apply_region, not totally working

 app/tools/gimpwarptool.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/app/tools/gimpwarptool.c b/app/tools/gimpwarptool.c
index e6f4fb0..0ea520e 100644
--- a/app/tools/gimpwarptool.c
+++ b/app/tools/gimpwarptool.c
@@ -512,22 +512,16 @@ gimp_warp_tool_create_image_map (GimpWarpTool *wt,
 static void
 gimp_warp_tool_image_map_update (GimpWarpTool *wt)
 {
-  GimpTool         *tool    = GIMP_TOOL (wt);
   GimpWarpOptions  *options = GIMP_WARP_TOOL_GET_OPTIONS (wt);
-  GimpDisplayShell *shell   = gimp_display_get_shell (tool->display);
-  GimpCoords        coords, result;
   GeglRectangle     region;
 
-  coords.x = wt->cursor_x;
-  coords.y = wt->cursor_y;
-
-  gimp_display_shell_untransform_coords (shell, &coords, &result);
-
-  region.x = result.x - options->effect_size / 2.0;
-  region.y = result.y - options->effect_size / 2.0;
+  region.x = wt->cursor_x - options->effect_size / 2.0;
+  region.y = wt->cursor_y - options->effect_size / 2.0;
   region.width = options->effect_size;
   region.height = options->effect_size;
 
+  printf("rect: (%d,%d), %dx%d\n", region.x, region.y, region.width, region.height);
+
   gimp_image_map_apply_region (wt->image_map, &region);
 }
 
@@ -565,6 +559,7 @@ gimp_warp_tool_add_op (GimpWarpTool *wt)
   gegl_node_connect_to (last_op, "output", new_op, "input");
   gegl_node_connect_to (new_op, "output", wt->render_node, "aux");
 }
+
 static void
 gimp_warp_tool_undo (GimpWarpTool *wt)
 {
@@ -575,7 +570,7 @@ gimp_warp_tool_undo (GimpWarpTool *wt)
   to_delete = gegl_node_get_producer (wt->render_node, "aux", NULL);
   type = gegl_node_get_operation(to_delete);
 
-  if (strcmp (type, "gimp:warp"))
+  if (strcmp (type, "gegl:warp"))
     return;
 
   previous = gegl_node_get_producer (to_delete, "input", NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]