[gimp] Issue #3134 - Deleting last layer of group not updating image
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Issue #3134 - Deleting last layer of group not updating image
- Date: Wed, 20 Mar 2019 21:51:12 +0000 (UTC)
commit a712308f20a216f98a03dbd60db0476aedfad2fe
Author: Ell <ell_se yahoo com>
Date: Wed Mar 20 17:45:03 2019 -0400
Issue #3134 - Deleting last layer of group not updating image
In gimp_group_layer_get_size(), make sure to always set *width and
*height, even when the group is empty, so that when the function is
called through gimp_projectable_get_size() by the group's
projection, the correct size is reported. This makes sure we
update the correct area when the group becomes empty.
app/core/gimpgrouplayer.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c
index 295fba66c0..438535c480 100644
--- a/app/core/gimpgrouplayer.c
+++ b/app/core/gimpgrouplayer.c
@@ -456,6 +456,7 @@ gimp_group_layer_get_size (GimpViewable *viewable,
gint *height)
{
GimpGroupLayerPrivate *private = GET_PRIVATE (viewable);
+ gboolean result;
if (private->reallocate_width != 0 &&
private->reallocate_height != 0)
@@ -466,13 +467,18 @@ gimp_group_layer_get_size (GimpViewable *viewable,
return TRUE;
}
- /* return the size only if there are children... */
- if (gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (private->children)))
- return GIMP_VIEWABLE_CLASS (parent_class)->get_size (viewable,
+ result = GIMP_VIEWABLE_CLASS (parent_class)->get_size (viewable,
width, height);
- /* ...otherwise return "no content" */
- return FALSE;
+ /* if the group is empty, return "no content" through
+ * gimp_viewable_get_size(), but make sure to set *width and *height anyway,
+ * so that the correct size is reported to the projection through
+ * gimp_projectable_get_size(). see issue #3134.
+ */
+ if (gimp_container_is_empty (private->children))
+ result = FALSE;
+
+ return result;
}
static GimpContainer *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]