[gimp] app: In GimpBlendTool, fix the preview for layers with offsets.



commit f7986e391e9bec44e1ed88fb4dc1052c4f59acf1
Author: Michael Henning <drawoc darkrefraction com>
Date:   Tue Jul 22 17:39:58 2014 -0400

    app: In GimpBlendTool, fix the preview for layers with offsets.

 app/tools/gimpblendtool.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index da3b8f5..4ee7c27 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -877,11 +877,16 @@ gimp_blend_tool_create_graph (GimpBlendTool *blend_tool)
 static void
 gimp_blend_tool_update_preview_coords (GimpBlendTool *blend_tool)
 {
+  GimpTool *tool = GIMP_TOOL (blend_tool);
+  gint      off_x, off_y;
+
+  gimp_item_get_offset (GIMP_ITEM (tool->drawable), &off_x, &off_y);
+
   gegl_node_set (blend_tool->render_node,
-                 "start_x", blend_tool->start_x,
-                 "start_y", blend_tool->start_y,
-                 "end_x",   blend_tool->end_x,
-                 "end_y",   blend_tool->end_y,
+                 "start_x", blend_tool->start_x - off_x,
+                 "start_y", blend_tool->start_y - off_y,
+                 "end_x",   blend_tool->end_x - off_x,
+                 "end_y",   blend_tool->end_y - off_y,
                  NULL);
 }
 


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