Commit 80beaa6b authored by Martin Nordholts's avatar Martin Nordholts

Bug 612931 - Moving individual layer in layer group not possible with Move...

Bug 612931 - Moving individual layer in layer group not possible with Move Tool in 'pick a layer' mode

When using GimpPickable::get_opacity_at(), don't consider group layers
as having content.
parent 743f6a50
......@@ -65,6 +65,7 @@ struct _GimpGroupLayerPrivate
static void gimp_projectable_iface_init (GimpProjectableInterface *iface);
static void gimp_pickable_iface_init (GimpPickableInterface *iface);
static void gimp_group_layer_finalize (GObject *object);
static void gimp_group_layer_set_property (GObject *object,
......@@ -135,6 +136,11 @@ static void gimp_group_layer_convert_type (GimpDrawable *drawabl
static GeglNode * gimp_group_layer_get_graph (GimpProjectable *projectable);
static GList * gimp_group_layer_get_layers (GimpProjectable *projectable);
static gint gimp_group_layer_get_opacity_at
(GimpPickable *pickable,
gint x,
gint y);
static void gimp_group_layer_child_add (GimpContainer *container,
GimpLayer *child,
......@@ -168,7 +174,10 @@ static void gimp_group_layer_proj_update (GimpProjection *proj,
G_DEFINE_TYPE_WITH_CODE (GimpGroupLayer, gimp_group_layer, GIMP_TYPE_LAYER,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROJECTABLE,
gimp_projectable_iface_init))
gimp_projectable_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PICKABLE,
gimp_pickable_iface_init))
#define parent_class gimp_group_layer_parent_class
......@@ -229,6 +238,12 @@ gimp_projectable_iface_init (GimpProjectableInterface *iface)
iface->get_channels = NULL;
}
static void
gimp_pickable_iface_init (GimpPickableInterface *iface)
{
iface->get_opacity_at = gimp_group_layer_get_opacity_at;
}
static void
gimp_group_layer_init (GimpGroupLayer *group)
{
......@@ -871,6 +886,15 @@ gimp_group_layer_get_layers (GimpProjectable *projectable)
return gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (private->children));
}
static gint
gimp_group_layer_get_opacity_at (GimpPickable *pickable,
gint x,
gint y)
{
/* Only consider child layers as having content */
return 0;
}
/* public functions */
......
......@@ -133,8 +133,7 @@ gimp_image_pick_text_layer (const GimpImage *image,
return GIMP_TEXT_LAYER (layer);
}
else if (! GIMP_IS_GROUP_LAYER (layer) &&
gimp_pickable_get_opacity_at (GIMP_PICKABLE (layer),
else if (gimp_pickable_get_opacity_at (GIMP_PICKABLE (layer),
x - off_x, y - off_y) > 63)
{
/* a normal layer covers any possible text layers below,
......
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