[gimp] app: fix text tool frame position when undoing move operation



commit 238c1035db5416f3a7f00c98358f2408d4069db2
Author: Ell <ell_se yahoo com>
Date:   Thu Sep 6 11:16:50 2018 -0400

    app: fix text tool frame position when undoing move operation
    
    While editing a text layer with the text tool, update the layer's
    frame when the layer moves, which most notably happens when
    undoing/redoing a move operation while the text tool is active.

 app/tools/gimptexttool.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index b5d8874e0b..93ddacc47d 100644
--- a/app/tools/gimptexttool.c
+++ b/app/tools/gimptexttool.c
@@ -1327,6 +1327,18 @@ gimp_text_tool_layer_notify (GimpTextLayer    *layer,
       if (! layer->text)
         gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, tool->display);
     }
+  else if (! strcmp (pspec->name, "offset-x") ||
+           ! strcmp (pspec->name, "offset-y"))
+    {
+      if (gimp_item_is_attached (GIMP_ITEM (layer)))
+        {
+          gimp_text_tool_block_drawing (text_tool);
+
+          gimp_text_tool_frame_item (text_tool);
+
+          gimp_text_tool_unblock_drawing (text_tool);
+        }
+    }
 }
 
 static gboolean


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