[gimp] Fix: The offset for seamless cloning should be relative to the drawable
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Fix: The offset for seamless cloning should be relative to the drawable
- Date: Tue, 14 May 2013 22:41:32 +0000 (UTC)
commit a3e136ab7f87e21deb4fb7d650b7844ee2d387a7
Author: Barak Itkin <lightningismyname gmail com>
Date: Sat Jun 23 22:56:17 2012 +0300
Fix: The offset for seamless cloning should be relative to the drawable
app/tools/gimpseamlessclonetool.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/app/tools/gimpseamlessclonetool.c b/app/tools/gimpseamlessclonetool.c
index bbf84bd..be09c0f 100644
--- a/app/tools/gimpseamlessclonetool.c
+++ b/app/tools/gimpseamlessclonetool.c
@@ -757,8 +757,6 @@ gimp_seamless_clone_tool_create_render_node (GimpSeamlessCloneTool *sc)
op = gegl_node_new_child (node,
"operation", "gegl:seamless-clone",
- "xoff", (gint) sc->xoff,
- "yoff", (gint) sc->yoff,
NULL);
overlay = gegl_node_new_child (node,
@@ -782,15 +780,25 @@ gimp_seamless_clone_tool_create_render_node (GimpSeamlessCloneTool *sc)
sc->render_node = node;
sc->sc_node = op;
+
+ gimp_seamless_clone_tool_render_node_update (sc);
}
static void
gimp_seamless_clone_tool_render_node_update (GimpSeamlessCloneTool *sc)
{
+ GimpDrawable *bg = GIMP_TOOL (sc)->drawable;
+ gint xoff, yoff;
+
+ /* Now we should also take into consideration the fact that
+ * we should work with coordinates relative to the background
+ * buffer */
+ gimp_item_get_offset (GIMP_ITEM (bg), &xoff, &yoff);
+
/* The only thing to update right now, is the location of the paste */
gegl_node_set (sc->sc_node,
- "xoff", (gint) sc->xoff,
- "yoff", (gint) sc->yoff,
+ "xoff", (gint) sc->xoff - xoff,
+ "yoff", (gint) sc->yoff - yoff,
NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]