Commit 601c213c authored by Ell's avatar Ell

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.
parent 238c1035
...@@ -1148,9 +1148,7 @@ gimp_text_tool_rectangle_change_complete (GimpToolRectangle *rectangle, ...@@ -1148,9 +1148,7 @@ gimp_text_tool_rectangle_change_complete (GimpToolRectangle *rectangle,
"y2", &y2, "y2", &y2,
NULL); NULL);
if (x1 != gimp_item_get_offset_x (item) || if ((x2 - x1) != gimp_item_get_width (item) ||
y1 != gimp_item_get_offset_y (item) ||
(x2 - x1) != gimp_item_get_width (item) ||
(y2 - y1) != gimp_item_get_height (item)) (y2 - y1) != gimp_item_get_height (item))
{ {
GimpUnit box_unit = text_tool->proxy->box_unit; GimpUnit box_unit = text_tool->proxy->box_unit;
...@@ -1190,15 +1188,35 @@ gimp_text_tool_rectangle_change_complete (GimpToolRectangle *rectangle, ...@@ -1190,15 +1188,35 @@ gimp_text_tool_rectangle_change_complete (GimpToolRectangle *rectangle,
(gpointer) item); (gpointer) item);
} }
gimp_text_tool_block_drawing (text_tool);
gimp_item_translate (item, gimp_item_translate (item,
x1 - gimp_item_get_offset_x (item), x1 - gimp_item_get_offset_x (item),
y1 - gimp_item_get_offset_y (item), y1 - gimp_item_get_offset_y (item),
push_undo); push_undo);
gimp_text_tool_apply (text_tool, push_undo); gimp_text_tool_apply (text_tool, push_undo);
gimp_text_tool_unblock_drawing (text_tool);
if (push_undo) if (push_undo)
gimp_image_undo_group_end (text_tool->image); 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);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment