Commit 341077e2 authored by Ell's avatar Ell

Bug 759194 - Unified Transform Tool fails when layer is hidden

Last commit reintroduced this bug.

Allow transforming invisible layers using transform-grid tools, by
adding a 'drawable' member to GimpTransformTool, and setting/
clearing it when initializing/halting a GimpTransformTool.  In
gimp_transform_tool_check_active_item(), skip the visibility check
if the active item equals the GimpTransformTool's 'drawable'
member.

(cherry picked from commit cea6f1dc)
parent d670edb3
......@@ -247,8 +247,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;
/* Initialize the transform_grid tool dialog */
if (! tg_tool->gui)
......@@ -865,7 +867,8 @@ gimp_transform_grid_tool_widget_response (GimpToolWidget *widget,
static void
gimp_transform_grid_tool_halt (GimpTransformGridTool *tg_tool)
{
GimpTool *tool = GIMP_TOOL (tg_tool);
GimpTool *tool = GIMP_TOOL (tg_tool);
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (tg_tool);
if (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (tg_tool)))
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tg_tool));
......@@ -891,8 +894,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;
}
static void
......@@ -905,11 +910,6 @@ gimp_transform_grid_tool_commit (GimpTransformGridTool *tg_tool)
/* undraw the tool before we muck around with the transform matrix */
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tg_tool));
/* un-hide the active item before transforming, so that GimpTransformTool
* doesn't refuse to transform it.
*/
gimp_transform_grid_tool_show_active_item (tg_tool);
gimp_transform_tool_transform (tr_tool, display);
}
......
......@@ -331,7 +331,8 @@ gimp_transform_tool_check_active_item (GimpTransformTool *tr_tool,
else if (gimp_item_is_position_locked (item))
locked_message = _("The active layer's position and size are locked.");
if (! gimp_item_is_visible (item))
if (! gimp_item_is_visible (item) &&
GIMP_DRAWABLE (item) != tr_tool->drawable) /* see bug #759194 */
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
_("The active layer is not visible."));
......
......@@ -47,6 +47,8 @@ struct _GimpTransformTool
{
GimpDrawTool parent_instance;
GimpDrawable *drawable;
gint x1, y1; /* upper left hand coordinate */
gint x2, y2; /* lower right hand coords */
......
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