[gimp/gimp-2-10] app: disable transform clipping for layer groups
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: disable transform clipping for layer groups
- Date: Sat, 18 Jan 2020 09:14:58 +0000 (UTC)
commit 44bf74a8d04f66843db0ac07dc064fd913460e09
Author: Ell <ell_se yahoo com>
Date: Sat Jan 18 11:05:06 2020 +0200
app: disable transform clipping for layer groups
Using any clipping mode other than ADJUST is currently broken for
layer groups, since each layer in the group is clipped
individually, instead of clipping being applied to the group as a
whole. Ultimately, we should fix that, but for now, simply disable
clipping for layer groups, by overriding GimpItem::get_clip() to
always return ADJUST.
(cherry picked from commit 203bc9d8939c74ad11a44cb77fb32f765732c602)
app/core/gimpgrouplayer.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c
index 052b64db73..485e5d2210 100644
--- a/app/core/gimpgrouplayer.c
+++ b/app/core/gimpgrouplayer.c
@@ -118,6 +118,9 @@ static void gimp_group_layer_resize (GimpItem *item,
gint new_height,
gint offset_x,
gint offset_y);
+static GimpTransformResize
+ gimp_group_layer_get_clip (GimpItem *item,
+ GimpTransformResize clip_result);
static gint64 gimp_group_layer_estimate_memsize (GimpDrawable *drawable,
GimpComponentType component_type,
@@ -277,6 +280,7 @@ gimp_group_layer_class_init (GimpGroupLayerClass *klass)
item_class->start_transform = gimp_group_layer_start_transform;
item_class->end_transform = gimp_group_layer_end_transform;
item_class->resize = gimp_group_layer_resize;
+ item_class->get_clip = gimp_group_layer_get_clip;
item_class->default_name = _("Layer Group");
item_class->rename_desc = C_("undo-type", "Rename Layer Group");
@@ -697,6 +701,16 @@ gimp_group_layer_resize (GimpItem *item,
gimp_group_layer_resume_resize (group, TRUE);
}
+static GimpTransformResize
+gimp_group_layer_get_clip (GimpItem *item,
+ GimpTransformResize clip_result)
+{
+ /* TODO: add clipping support, by clipping all sublayers as a unit, instead
+ * of individually.
+ */
+ return GIMP_TRANSFORM_RESIZE_ADJUST;
+}
+
static gint64
gimp_group_layer_estimate_memsize (GimpDrawable *drawable,
GimpComponentType component_type,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]