[gimp/gimp-2-10] app: don't change text-layer box mode after moving using text tool
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: don't change text-layer box mode after moving using text tool
- Date: Wed, 12 Sep 2018 11:55:56 +0000 (UTC)
commit b1652b02d8c3936f835341e1e9e3048ac85c94d6
Author: Ell <ell_se yahoo com>
Date: Thu Sep 6 11:43:12 2018 -0400
app: don't change text-layer box mode after moving using text tool
When moving a text layer using the text tool (through alt+drag),
don't change the layer's box mode to "fixed", which is unnecessary,
since the layer's size isn't affected.
(cherry picked from commit 601c213c7a8ae33fdfc6f395e31ddff728c6dc0b)
app/tools/gimptexttool.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index 610385d063..5edad2403a 100644
--- a/app/tools/gimptexttool.c
+++ b/app/tools/gimptexttool.c
@@ -1148,9 +1148,7 @@ gimp_text_tool_rectangle_change_complete (GimpToolRectangle *rectangle,
"y2", &y2,
NULL);
- if (x1 != gimp_item_get_offset_x (item) ||
- y1 != gimp_item_get_offset_y (item) ||
- (x2 - x1) != gimp_item_get_width (item) ||
+ if ((x2 - x1) != gimp_item_get_width (item) ||
(y2 - y1) != gimp_item_get_height (item))
{
GimpUnit box_unit = text_tool->proxy->box_unit;
@@ -1190,15 +1188,35 @@ gimp_text_tool_rectangle_change_complete (GimpToolRectangle *rectangle,
(gpointer) item);
}
+ gimp_text_tool_block_drawing (text_tool);
+
gimp_item_translate (item,
x1 - gimp_item_get_offset_x (item),
y1 - gimp_item_get_offset_y (item),
push_undo);
gimp_text_tool_apply (text_tool, push_undo);
+ gimp_text_tool_unblock_drawing (text_tool);
+
if (push_undo)
gimp_image_undo_group_end (text_tool->image);
}
+ else if (x1 != gimp_item_get_offset_x (item) ||
+ y1 != gimp_item_get_offset_y (item))
+ {
+ gimp_text_tool_block_drawing (text_tool);
+
+ gimp_text_tool_apply (text_tool, TRUE);
+
+ gimp_item_translate (item,
+ x1 - gimp_item_get_offset_x (item),
+ y1 - gimp_item_get_offset_y (item),
+ TRUE);
+
+ gimp_text_tool_unblock_drawing (text_tool);
+
+ gimp_image_flush (text_tool->image);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]