[gimp/gimp-2-10] Issue #2308 - Strange behavior when switching active layer during transform
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] Issue #2308 - Strange behavior when switching active layer during transform
- Date: Fri, 5 Oct 2018 01:52:41 +0000 (UTC)
commit e0e825580bd66626e095555364721640f9e285f4
Author: Ell <ell_se yahoo com>
Date: Thu Oct 4 21:46:10 2018 -0400
Issue #2308 - Strange behavior when switching active layer during transform
Replace GimpTransformTool's 'drawable' field with an 'item' field,
and have GimpTransformGridTool set it to the active item, to which
the transformation is applied, during its initialization. In
gimp_transform_tool_get_active_item(), return the value of the
transform tool's 'item' field, if not NULL, instead of the image's
active item. This makes sure we apply that transform-grid tools
apply the transformation for the item for which they were
activated, even if the image's active item has changed.
(cherry picked from commit 3eaae585957eb1f008a9c203f7ecd2daf256cec0)
app/tools/gimptransformgridtool.c | 12 ++++++------
app/tools/gimptransformtool.c | 5 ++++-
app/tools/gimptransformtool.h | 2 +-
3 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/app/tools/gimptransformgridtool.c b/app/tools/gimptransformgridtool.c
index 00adce654d..5badcef12a 100644
--- a/app/tools/gimptransformgridtool.c
+++ b/app/tools/gimptransformgridtool.c
@@ -252,10 +252,10 @@ gimp_transform_grid_tool_initialize (GimpTool *tool,
if (! item)
return FALSE;
- tool->display = display;
- tool->drawable = drawable;
+ tool->display = display;
+ tool->drawable = drawable;
- tr_tool->drawable = drawable;
+ tr_tool->item = item;
/* Initialize the transform_grid tool dialog */
if (! tg_tool->gui)
@@ -873,10 +873,10 @@ gimp_transform_grid_tool_halt (GimpTransformGridTool *tg_tool)
gimp_transform_grid_tool_show_active_item (tg_tool);
- tool->display = NULL;
- tool->drawable = NULL;
+ tool->display = NULL;
+ tool->drawable = NULL;
- tr_tool->drawable = NULL;
+ tr_tool->item = NULL;
}
static void
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index d89ea23f7c..284e1ca863 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -458,6 +458,9 @@ gimp_transform_tool_get_active_item (GimpTransformTool *tr_tool,
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+ if (tr_tool->item)
+ return tr_tool->item;
+
switch (options->type)
{
case GIMP_TRANSFORM_TYPE_LAYER:
@@ -510,7 +513,7 @@ gimp_transform_tool_check_active_item (GimpTransformTool *tr_tool,
locked_message = _("The active layer's position and size are locked.");
if (! gimp_item_is_visible (item) &&
- GIMP_DRAWABLE (item) != tr_tool->drawable) /* see bug #759194 */
+ item != tr_tool->item) /* see bug #759194 */
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
_("The active layer is not visible."));
diff --git a/app/tools/gimptransformtool.h b/app/tools/gimptransformtool.h
index 04664df164..fb6899a860 100644
--- a/app/tools/gimptransformtool.h
+++ b/app/tools/gimptransformtool.h
@@ -47,7 +47,7 @@ struct _GimpTransformTool
{
GimpDrawTool parent_instance;
- GimpDrawable *drawable;
+ GimpItem *item;
gint x1, y1; /* upper left hand coordinate */
gint x2, y2; /* lower right hand coords */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]