app: optimize gimp_layer_invalidate_boundary()
Don't mess with the image's mask if the layer is not attached or not visible.
This commit is contained in:
@ -1425,24 +1425,23 @@ gimp_layer_convert_type (GimpDrawable *drawable,
|
|||||||
static void
|
static void
|
||||||
gimp_layer_invalidate_boundary (GimpDrawable *drawable)
|
gimp_layer_invalidate_boundary (GimpDrawable *drawable)
|
||||||
{
|
{
|
||||||
GimpLayer *layer = GIMP_LAYER (drawable);
|
GimpLayer *layer = GIMP_LAYER (drawable);
|
||||||
GimpImage *image;
|
|
||||||
GimpChannel *mask;
|
|
||||||
|
|
||||||
if (! (image = gimp_item_get_image (GIMP_ITEM (layer))))
|
if (gimp_item_is_attached (GIMP_ITEM (drawable)) &&
|
||||||
return;
|
gimp_item_is_visible (GIMP_ITEM (drawable)))
|
||||||
|
|
||||||
/* Turn the current selection off */
|
|
||||||
gimp_image_selection_invalidate (image);
|
|
||||||
|
|
||||||
/* get the selection mask channel */
|
|
||||||
mask = gimp_image_get_mask (image);
|
|
||||||
|
|
||||||
/* Only bother with the bounds if there is a selection */
|
|
||||||
if (! gimp_channel_is_empty (mask))
|
|
||||||
{
|
{
|
||||||
mask->bounds_known = FALSE;
|
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||||
mask->boundary_known = FALSE;
|
GimpChannel *mask = gimp_image_get_mask (image);
|
||||||
|
|
||||||
|
/* Turn the current selection off */
|
||||||
|
gimp_image_selection_invalidate (image);
|
||||||
|
|
||||||
|
/* Only bother with the bounds if there is a selection */
|
||||||
|
if (! gimp_channel_is_empty (mask))
|
||||||
|
{
|
||||||
|
mask->bounds_known = FALSE;
|
||||||
|
mask->boundary_known = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gimp_layer_is_floating_sel (layer))
|
if (gimp_layer_is_floating_sel (layer))
|
||||||
|
Reference in New Issue
Block a user