Commit 40cf6fa6 authored by Michael Natterer's avatar Michael Natterer 😴

Allow scaling of group layers even though they appear locked

parent bdf01c64
......@@ -503,6 +503,7 @@ layers_actions_update (GimpActionGroup *group,
gboolean can_lock_alpha = FALSE;
gboolean text_layer = FALSE;
gboolean writable = FALSE;
gboolean children = FALSE;
GList *next = NULL;
GList *next_visible = NULL;
GList *prev = NULL;
......@@ -527,6 +528,9 @@ layers_actions_update (GimpActionGroup *group,
alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
writable = ! gimp_item_get_lock_content (GIMP_ITEM (layer));
if (gimp_viewable_get_children (GIMP_VIEWABLE (layer)))
children = TRUE;
layer_list = gimp_item_get_container_iter (GIMP_ITEM (layer));
list = g_list_find (layer_list, layer);
......@@ -591,7 +595,7 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-resize", writable && !ac);
SET_SENSITIVE ("layers-resize-to-image", writable && !ac);
SET_SENSITIVE ("layers-scale", writable && !ac);
SET_SENSITIVE ("layers-scale", (writable || children) && !ac);
SET_SENSITIVE ("layers-crop", writable && sel);
......
......@@ -288,7 +288,10 @@ layer_scale_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
/* group items are transformable even though they appear locked */
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error) &&
(gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
gimp_pdb_item_is_writable (GIMP_ITEM (layer), error)))
{
if (progress)
gimp_progress_start (progress, _("Scaling"), FALSE);
......@@ -333,7 +336,10 @@ layer_scale_full_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
/* group items are transformable even though they appear locked */
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error) &&
(gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
gimp_pdb_item_is_writable (GIMP_ITEM (layer), error)))
{
if (progress)
gimp_progress_start (progress, _("Scaling"), FALSE);
......
......@@ -343,7 +343,10 @@ HELP
%invoke = (
code => <<'CODE'
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
/* group items are transformable even though they appear locked */
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error) &&
(gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
gimp_pdb_item_is_writable (GIMP_ITEM (layer), error)))
{
if (progress)
gimp_progress_start (progress, _("Scaling"), FALSE);
......@@ -394,7 +397,10 @@ HELP
%invoke = (
code => <<'CODE'
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), TRUE, error))
/* group items are transformable even though they appear locked */
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), FALSE, error) &&
(gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
gimp_pdb_item_is_writable (GIMP_ITEM (layer), error)))
{
if (progress)
gimp_progress_start (progress, _("Scaling"), FALSE);
......
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