Commit 5dd9e4bb authored by Michael Natterer's avatar Michael Natterer 😴

app: remove member GimpDrawable::has_alpha

because it is always the same as GIMP_IMAGE_TYPE_HAS_ALPHA(drawable->type),
so simply use that instead.
parent 8a27702a
......@@ -254,13 +254,12 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
static void
gimp_drawable_init (GimpDrawable *drawable)
{
drawable->private = G_TYPE_INSTANCE_GET_PRIVATE (drawable,
GIMP_TYPE_DRAWABLE,
GimpDrawablePrivate);
drawable->private = G_TYPE_INSTANCE_GET_PRIVATE (drawable,
GIMP_TYPE_DRAWABLE,
GimpDrawablePrivate);
drawable->bytes = 0;
drawable->type = -1;
drawable->has_alpha = FALSE;
drawable->bytes = 0;
drawable->type = -1;
}
/* sorry for the evil casts */
......@@ -832,7 +831,6 @@ gimp_drawable_real_set_tiles (GimpDrawable *drawable,
drawable->private->tiles = tiles;
drawable->type = type;
drawable->bytes = tile_manager_bpp (tiles);
drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
gimp_item_set_offset (item, offset_x, offset_y);
gimp_item_set_size (item,
......@@ -1207,9 +1205,8 @@ gimp_drawable_configure (GimpDrawable *drawable,
gimp_item_configure (GIMP_ITEM (drawable), image,
offset_x, offset_y, width, height, name);
drawable->type = type;
drawable->bytes = GIMP_IMAGE_TYPE_BYTES (type);
drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
drawable->type = type;
drawable->bytes = GIMP_IMAGE_TYPE_BYTES (type);
if (drawable->private->tiles)
tile_manager_unref (drawable->private->tiles);
......@@ -1861,7 +1858,7 @@ gimp_drawable_has_alpha (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->has_alpha;
return GIMP_IMAGE_TYPE_HAS_ALPHA (gimp_drawable_type (drawable));
}
GimpImageType
......
......@@ -39,7 +39,6 @@ struct _GimpDrawable
gint bytes; /* bytes per pixel */
GimpImageType type; /* type of drawable */
gboolean has_alpha; /* drawable has alpha */
GimpDrawablePrivate *private;
};
......
......@@ -221,9 +221,8 @@ gimp_text_layer_from_layer (GimpLayer *layer,
drawable->private->tiles = gimp_drawable_get_tiles (GIMP_DRAWABLE (layer));
GIMP_DRAWABLE (layer)->private->tiles = NULL;
drawable->bytes = gimp_drawable_bytes (GIMP_DRAWABLE (layer));
drawable->type = gimp_drawable_type (GIMP_DRAWABLE (layer));
drawable->has_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
drawable->bytes = gimp_drawable_bytes (GIMP_DRAWABLE (layer));
drawable->type = gimp_drawable_type (GIMP_DRAWABLE (layer));
gimp_layer_set_opacity (GIMP_LAYER (text_layer),
gimp_layer_get_opacity (layer), 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