[gimp] Bug 735906 - Transform tools give unexpected results when transforming...
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 735906 - Transform tools give unexpected results when transforming...
- Date: Fri, 26 Jun 2015 10:01:01 +0000 (UTC)
commit 3c706d00c67d675bdb8c255b3fff88490fde82bc
Author: Michael Natterer <mitch gimp org>
Date: Fri Jun 26 11:56:59 2015 +0200
Bug 735906 - Transform tools give unexpected results when transforming...
...certain sets of linked layers
Fix for translating layers from the PDB, and with the cursor keys
for gimpeditselectiontool. Moving layers with the mouse is still broken.
The approach is exactly the same as in 25a696c7.
app/core/gimpitem-linked.c | 17 ++++++++++-------
app/pdb/layer-cmds.c | 37 ++++++++++++++++---------------------
app/tools/gimpeditselectiontool.c | 11 +++++++----
tools/pdbgen/pdb/layer.pdb | 37 ++++++++++++++++---------------------
4 files changed, 49 insertions(+), 53 deletions(-)
---
diff --git a/app/core/gimpitem-linked.c b/app/core/gimpitem-linked.c
index 1dcdd68..0a3fc03 100644
--- a/app/core/gimpitem-linked.c
+++ b/app/core/gimpitem-linked.c
@@ -80,22 +80,25 @@ gimp_item_linked_translate (GimpItem *item,
gint offset_y,
gboolean push_undo)
{
- GList *list;
+ GimpImage *image;
+ GList *items;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_get_linked (item) == TRUE);
g_return_if_fail (gimp_item_is_attached (item));
- list = gimp_image_item_list_get_list (gimp_item_get_image (item), item,
- GIMP_ITEM_TYPE_ALL,
- GIMP_ITEM_SET_LINKED);
+ image = gimp_item_get_image (item);
- list = gimp_image_item_list_filter (item, list);
+ items = gimp_image_item_list_get_list (image, NULL,
+ GIMP_ITEM_TYPE_ALL,
+ GIMP_ITEM_SET_LINKED);
- gimp_image_item_list_translate (gimp_item_get_image (item), list,
+ items = gimp_image_item_list_filter (NULL, items);
+
+ gimp_image_item_list_translate (gimp_item_get_image (item), items,
offset_x, offset_y, push_undo);
- g_list_free (list);
+ g_list_free (items);
}
void
diff --git a/app/pdb/layer-cmds.c b/app/pdb/layer-cmds.c
index d3819be..747b67e 100644
--- a/app/pdb/layer-cmds.c
+++ b/app/pdb/layer-cmds.c
@@ -542,17 +542,14 @@ layer_translate_invoker (GimpProcedure *procedure,
if (gimp_pdb_item_is_modifyable (GIMP_ITEM (layer),
GIMP_PDB_ITEM_POSITION, error))
{
- GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
-
- gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
- _("Move Layer"));
-
- gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
-
if (gimp_item_get_linked (GIMP_ITEM (layer)))
- gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
-
- gimp_image_undo_group_end (image);
+ {
+ gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
+ }
+ else
+ {
+ gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
+ }
}
else
success = FALSE;
@@ -584,23 +581,21 @@ layer_set_offsets_invoker (GimpProcedure *procedure,
if (gimp_pdb_item_is_modifyable (GIMP_ITEM (layer),
GIMP_PDB_ITEM_POSITION, error))
{
- GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
- gint offset_x;
- gint offset_y;
-
- gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
- _("Move Layer"));
+ gint offset_x;
+ gint offset_y;
gimp_item_get_offset (GIMP_ITEM (layer), &offset_x, &offset_y);
offx -= offset_x;
offy -= offset_y;
- gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
-
if (gimp_item_get_linked (GIMP_ITEM (layer)))
- gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
-
- gimp_image_undo_group_end (image);
+ {
+ gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
+ }
+ else
+ {
+ gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
+ }
}
else
success = FALSE;
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index 563f844..8e6193f 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -1284,11 +1284,14 @@ gimp_edit_selection_tool_translate (GimpTool *tool,
case GIMP_TRANSLATE_MODE_VECTORS:
case GIMP_TRANSLATE_MODE_CHANNEL:
case GIMP_TRANSLATE_MODE_LAYER:
- gimp_item_translate (item, inc_x, inc_y, push_undo);
-
- /* translate all linked items as well */
if (gimp_item_get_linked (item))
- gimp_item_linked_translate (item, inc_x, inc_y, push_undo);
+ {
+ gimp_item_linked_translate (item, inc_x, inc_y, push_undo);
+ }
+ else
+ {
+ gimp_item_translate (item, inc_x, inc_y, push_undo);
+ }
break;
case GIMP_TRANSLATE_MODE_FLOATING_SEL:
diff --git a/tools/pdbgen/pdb/layer.pdb b/tools/pdbgen/pdb/layer.pdb
index c2b46df..e74017c 100644
--- a/tools/pdbgen/pdb/layer.pdb
+++ b/tools/pdbgen/pdb/layer.pdb
@@ -627,17 +627,14 @@ HELP
if (gimp_pdb_item_is_modifyable (GIMP_ITEM (layer),
GIMP_PDB_ITEM_POSITION, error))
{
- GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
-
- gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
- _("Move Layer"));
-
- gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
-
if (gimp_item_get_linked (GIMP_ITEM (layer)))
- gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
-
- gimp_image_undo_group_end (image);
+ {
+ gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
+ }
+ else
+ {
+ gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
+ }
}
else
success = FALSE;
@@ -739,23 +736,21 @@ HELP
if (gimp_pdb_item_is_modifyable (GIMP_ITEM (layer),
GIMP_PDB_ITEM_POSITION, error))
{
- GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
- gint offset_x;
- gint offset_y;
-
- gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
- _("Move Layer"));
+ gint offset_x;
+ gint offset_y;
gimp_item_get_offset (GIMP_ITEM (layer), &offset_x, &offset_y);
offx -= offset_x;
offy -= offset_y;
- gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
-
if (gimp_item_get_linked (GIMP_ITEM (layer)))
- gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
-
- gimp_image_undo_group_end (image);
+ {
+ gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
+ }
+ else
+ {
+ gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
+ }
}
else
success = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]