Commit 95235369 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Forgot some gint opacity values:

2002-03-04  Michael Natterer  <mitch@gimp.org>

	Forgot some gint opacity values:

	* app/core/gimplayer.[ch]: layer->opacity, gimp_layer_new(),
	gimp_layer_new_from_tiles()

	* app/core/gimpimage-projection.[ch]: gimp_image_projection_opacity()

	* app/core/gimpdrawable-transform.c
	* app/core/gimpedit.c
	* app/core/gimpimage-mask.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-new.c
	* app/core/gimpimage.c
	* app/core/gimplayer-floating-sel.c
	* app/gui/layers-commands.c
	* app/tools/gimptexttool.c
	* app/widgets/gimplayerlistview.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/layer_cmds.c
	* libgimp/gimplayer_pdb.c: regenerated.
parent ddc01ea9
2002-03-04 Michael Natterer <mitch@gimp.org>
Forgot some gint opacity values:
* app/core/gimplayer.[ch]: layer->opacity, gimp_layer_new(),
gimp_layer_new_from_tiles()
* app/core/gimpimage-projection.[ch]: gimp_image_projection_opacity()
* app/core/gimpdrawable-transform.c
* app/core/gimpedit.c
* app/core/gimpimage-mask.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-new.c
* app/core/gimpimage.c
* app/core/gimplayer-floating-sel.c
* app/gui/layers-commands.c
* app/tools/gimptexttool.c
* app/widgets/gimplayerlistview.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
* app/pdb/layer_cmds.c
* libgimp/gimplayer_pdb.c: regenerated.
2002-03-03 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-contiguous-region.c: some cleanup, removed
unused parameters and code.
* app/widgets/gimptoolinfopreview.c: fixed stupid bug I introduced
yesterday.
......
......@@ -430,9 +430,12 @@ new_layer_query_ok_callback (GtkWidget *widget,
if ((gimage = options->gimage))
{
layer = gimp_layer_new (gimage, options->xsize, options->ysize,
layer = gimp_layer_new (gimage,
options->xsize,
options->ysize,
gimp_image_base_type_with_alpha (gimage),
layer_name, OPAQUE_OPACITY, GIMP_NORMAL_MODE);
layer_name,
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (layer)
{
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
......@@ -491,7 +494,9 @@ layers_new_layer_query (GimpImage *gimage,
undo_push_group_start (gimage, EDIT_PASTE_UNDO_GROUP);
new_layer = gimp_layer_new (gimage, width, height,
new_layer = gimp_layer_new (gimage,
width,
height,
gimp_image_base_type_with_alpha (gimage),
_("Empty Layer Copy"),
template->opacity,
......
......@@ -176,12 +176,12 @@ gimp_edit_paste (GimpImage *gimage,
layer = gimp_layer_new_from_tiles (paste->tiles,
gimage,
_("Pasted Layer"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
else
layer = gimp_layer_new_from_tiles (paste->tiles,
gimage,
_("Pasted Layer"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (! layer)
return NULL;
......@@ -256,7 +256,7 @@ gimp_edit_paste_as_new (Gimp *gimp,
layer = gimp_layer_new_from_tiles (paste->tiles,
gimage,
_("Pasted Layer"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (layer)
{
......
......@@ -748,7 +748,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
gimp_layer_new_from_tiles (tiles,
gimage,
_("Transformation"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (! layer)
{
g_warning ("%s: gimp_layer_new_frome_tiles() failed",
......
......@@ -748,7 +748,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
gimp_layer_new_from_tiles (tiles,
gimage,
_("Transformation"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (! layer)
{
g_warning ("%s: gimp_layer_new_frome_tiles() failed",
......
......@@ -176,12 +176,12 @@ gimp_edit_paste (GimpImage *gimage,
layer = gimp_layer_new_from_tiles (paste->tiles,
gimage,
_("Pasted Layer"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
else
layer = gimp_layer_new_from_tiles (paste->tiles,
gimage,
_("Pasted Layer"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (! layer)
return NULL;
......@@ -256,7 +256,7 @@ gimp_edit_paste_as_new (Gimp *gimp,
layer = gimp_layer_new_from_tiles (paste->tiles,
gimage,
_("Pasted Layer"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (layer)
{
......
......@@ -395,7 +395,7 @@ gimp_image_mask_float (GimpImage *gimage,
layer = gimp_layer_new_from_tiles (tiles,
gimage,
_("Floating Selection"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
/* Set the offsets */
tile_manager_get_offsets (tiles, &x1, &y1);
......
......@@ -310,7 +310,7 @@ gimp_image_merge_layers (GimpImage *gimage,
merge_layer = gimp_layer_new (gimage, (x2 - x1), (y2 - y1),
type,
gimp_object_get_name (GIMP_OBJECT (layer)),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (!merge_layer)
{
g_warning ("%s: could not allocate merge layer.",
......@@ -348,7 +348,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gimp_layer_new (gimage, (x2 - x1), (y2 - y1),
gimp_drawable_type_with_alpha (GIMP_DRAWABLE (layer)),
"merged layer",
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (!merge_layer)
{
......@@ -449,7 +449,10 @@ gimp_image_merge_layers (GimpImage *gimage,
}
combine_regions (&src1PR, &src2PR, &src1PR, mask, NULL,
layer->opacity, layer->mode, active, operation);
layer->opacity * 255.999,
layer->mode,
active,
operation);
gimp_image_remove_layer (gimage, layer);
reverse_list = g_slist_next (reverse_list);
......
......@@ -270,7 +270,7 @@ gimp_image_new_create_image (Gimp *gimp,
layer = gimp_layer_new (gimage, width, height,
type, _("Background"),
OPAQUE_OPACITY, GIMP_NORMAL_MODE);
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
if (layer)
{
......
......@@ -167,12 +167,12 @@ gimp_image_projection_bytes (const GimpImage *gimage)
return gimage->proj_bytes;
}
gint
gdouble
gimp_image_projection_opacity (const GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_OPACITY_OPAQUE);
return OPAQUE_OPACITY;
return GIMP_OPACITY_OPAQUE;
}
guchar *
......@@ -597,7 +597,7 @@ gimp_image_construct (GimpImage *gimage,
gimage->height) && /* Covers all. */
(!gimp_drawable_is_indexed (GIMP_DRAWABLE (gimage->layers->data))) &&
/* Not indexed. */
(((GimpLayer *)(gimage->layers->data))->opacity == OPAQUE_OPACITY)
(((GimpLayer *)(gimage->layers->data))->opacity == GIMP_OPACITY_OPAQUE)
/* Opaque */
)
{
......@@ -661,11 +661,17 @@ project_intensity (GimpImage *gimage,
PixelRegion *mask)
{
if (! gimage->construct_flag)
initial_region (src, dest, mask, NULL, layer->opacity,
layer->mode, gimage->visible, INITIAL_INTENSITY);
initial_region (src, dest, mask, NULL,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
INITIAL_INTENSITY);
else
combine_regions (dest, src, dest, mask, NULL, layer->opacity,
layer->mode, gimage->visible, COMBINE_INTEN_A_INTEN);
combine_regions (dest, src, dest, mask, NULL,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
COMBINE_INTEN_A_INTEN);
}
static void
......@@ -676,11 +682,17 @@ project_intensity_alpha (GimpImage *gimage,
PixelRegion *mask)
{
if (! gimage->construct_flag)
initial_region (src, dest, mask, NULL, layer->opacity,
layer->mode, gimage->visible, INITIAL_INTENSITY_ALPHA);
initial_region (src, dest, mask, NULL,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
INITIAL_INTENSITY_ALPHA);
else
combine_regions (dest, src, dest, mask, NULL, layer->opacity,
layer->mode, gimage->visible, COMBINE_INTEN_A_INTEN_A);
combine_regions (dest, src, dest, mask, NULL,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
COMBINE_INTEN_A_INTEN_A);
}
static void
......@@ -690,8 +702,11 @@ project_indexed (GimpImage *gimage,
PixelRegion *dest)
{
if (! gimage->construct_flag)
initial_region (src, dest, NULL, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, INITIAL_INDEXED);
initial_region (src, dest, NULL, gimage->cmap,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
INITIAL_INDEXED);
else
g_warning ("%s: unable to project indexed image.", G_GNUC_PRETTY_FUNCTION);
}
......@@ -704,11 +719,17 @@ project_indexed_alpha (GimpImage *gimage,
PixelRegion *mask)
{
if (! gimage->construct_flag)
initial_region (src, dest, mask, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, INITIAL_INDEXED_ALPHA);
initial_region (src, dest, mask, gimage->cmap,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
INITIAL_INDEXED_ALPHA);
else
combine_regions (dest, src, dest, mask, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, COMBINE_INTEN_A_INDEXED_A);
combine_regions (dest, src, dest, mask, gimage->cmap,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
COMBINE_INTEN_A_INDEXED_A);
}
static void
......@@ -729,15 +750,21 @@ project_channel (GimpImage *gimage,
type = (channel->show_masked) ?
INITIAL_CHANNEL_MASK : INITIAL_CHANNEL_SELECTION;
initial_region (src2, src, NULL, col, opacity,
GIMP_NORMAL_MODE, NULL, type);
initial_region (src2, src, NULL, col,
opacity,
GIMP_NORMAL_MODE,
NULL,
type);
}
else
{
type = (channel->show_masked) ?
COMBINE_INTEN_A_CHANNEL_MASK : COMBINE_INTEN_A_CHANNEL_SELECTION;
combine_regions (src, src2, src, NULL, col, opacity,
GIMP_NORMAL_MODE, NULL, type);
combine_regions (src, src2, src, NULL, col,
opacity,
GIMP_NORMAL_MODE,
NULL,
type);
}
}
......@@ -26,7 +26,7 @@ void gimp_image_projection_free (GimpImage *gimage);
TileManager * gimp_image_projection (GimpImage *gimage);
GimpImageType gimp_image_projection_type (const GimpImage *gimage);
gint gimp_image_projection_bytes (const GimpImage *gimage);
gint gimp_image_projection_opacity (const GimpImage *gimage);
gdouble gimp_image_projection_opacity (const GimpImage *gimage);
guchar * gimp_image_projection_get_color_at (GimpImage *gimage,
gint x,
......
......@@ -837,14 +837,14 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (! construct_flag)
initial_region (&src2PR, &src1PR,
mask, NULL,
layer->opacity,
layer->opacity * 255.999,
layer->mode,
visible_components,
INITIAL_INTENSITY_ALPHA);
else
combine_regions (&src1PR, &src2PR, &src1PR,
mask, NULL,
layer->opacity,
layer->opacity * 255.999,
layer->mode,
visible_components,
COMBINE_INTEN_A_INTEN_A);
......@@ -854,14 +854,14 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (! construct_flag)
initial_region (&src2PR, &src1PR,
mask, NULL,
layer->opacity,
layer->opacity * 255.999,
layer->mode,
visible_components,
INITIAL_INTENSITY);
else
combine_regions (&src1PR, &src2PR, &src1PR,
mask, NULL,
layer->opacity,
layer->opacity * 255.999,
layer->mode,
visible_components,
COMBINE_INTEN_A_INTEN);
......@@ -1846,15 +1846,20 @@ gimp_image_apply_image (GimpImage *gimage,
mx, my,
(x2 - x1), (y2 - y1),
FALSE);
combine_regions (&src1PR, src2PR, &destPR, &maskPR, NULL,
opacity * 255.999, mode,
active_components, operation);
opacity * 255.999,
mode,
active_components,
operation);
}
else
{
combine_regions (&src1PR, src2PR, &destPR, NULL, NULL,
opacity * 255.999, mode,
active_components, operation);
opacity * 255.999,
mode,
active_components,
operation);
}
}
......@@ -1983,7 +1988,8 @@ gimp_image_replace_image (GimpImage *gimage,
combine_regions_replace (&src1PR, src2PR, &destPR, &tempPR, NULL,
opacity * 255.999,
active_components, operation);
active_components,
operation);
g_free (temp_data);
}
......@@ -1991,7 +1997,8 @@ gimp_image_replace_image (GimpImage *gimage,
{
combine_regions_replace (&src1PR, src2PR, &destPR, maskPR, NULL,
opacity * 255.999,
active_components, operation);
active_components,
operation);
}
}
......
......@@ -464,9 +464,8 @@ floating_sel_composite (GimpLayer *layer,
/* apply the fs with the undo specified by the value
* passed to this function
*/
gimp_image_apply_image (gimage, layer->fs.drawable, &fsPR,
undo,
(gdouble) layer->opacity / 255.0,
gimp_image_apply_image (gimage, layer->fs.drawable, &fsPR, undo,
layer->opacity,
layer->mode,
NULL,
(x1 - offx), (y1 - offy));
......
......@@ -186,7 +186,7 @@ gimp_layer_init (GimpLayer *layer)
layer->mask = NULL;
layer->opacity = OPAQUE_OPACITY;
layer->opacity = GIMP_OPACITY_OPAQUE;
layer->mode = GIMP_NORMAL_MODE;
/* floating selection */
......@@ -310,16 +310,14 @@ gimp_layer_new (GimpImage *gimage,
gint height,
GimpImageType type,
const gchar *name,
gint opacity,
gdouble opacity,
GimpLayerModeEffects mode)
{
GimpLayer *layer;
if (width < 1 || height < 1)
{
g_message (_("Zero width or height layers not allowed."));
return NULL;
}
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (width > 0, NULL);
g_return_val_if_fail (height > 0, NULL);
layer = g_object_new (GIMP_TYPE_LAYER, NULL);
......@@ -329,8 +327,10 @@ gimp_layer_new (GimpImage *gimage,
type,
name);
layer->mode = mode;
opacity = CLAMP (opacity, GIMP_OPACITY_TRANSPARENT, GIMP_OPACITY_OPAQUE);
layer->opacity = opacity;
layer->mode = mode;
return layer;
}
......@@ -366,35 +366,47 @@ gimp_layer_copy (const GimpLayer *layer,
return new_layer;
}
/**
* gimp_layer_new_from_tiles:
* @tiles: The buffer to make the new layer from.
* @dest_gimage: The image the new layer will be added to.
* @name: The new layer's name.
* @opacity: The new layer's opacity.
* @mode: The new layer's mode.
*
* Copies %tiles to a layer taking into consideration the
* possibility of transforming the contents to meet the requirements
* of the target image type
*
* Return value: The new layer.
**/
GimpLayer *
gimp_layer_new_from_tiles (TileManager *tiles,
GimpImage *dest_gimage,
const gchar *name,
gint opacity,
gdouble opacity,
GimpLayerModeEffects mode)
{
GimpLayer *new_layer;
PixelRegion layerPR;
PixelRegion bufPR;
/* Function copies buffer to a layer
* taking into consideration the possibility of transforming
* the contents to meet the requirements of the target image type
*/
gint width, height;
g_return_val_if_fail (tiles != NULL, NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (dest_gimage), NULL);
g_return_val_if_fail (name != NULL, NULL);
width = tile_manager_width (tiles);
height = tile_manager_height (tiles);
new_layer = gimp_layer_new (dest_gimage,
tile_manager_width (tiles),
tile_manager_height (tiles),
width, height,
gimp_image_base_type_with_alpha (dest_gimage),
name,
opacity,
mode);
if (!new_layer)
if (! new_layer)
{
g_message ("gimp_layer_new_from_tiles: could not allocate new layer");
return NULL;
......@@ -403,13 +415,11 @@ gimp_layer_new_from_tiles (TileManager *tiles,
/* Configure the pixel regions */
pixel_region_init (&bufPR, tiles,
0, 0,
GIMP_DRAWABLE (new_layer)->width,
GIMP_DRAWABLE (new_layer)->height,
width, height,
FALSE);
pixel_region_init (&layerPR, GIMP_DRAWABLE (new_layer)->tiles,
0, 0,
GIMP_DRAWABLE (new_layer)->width,
GIMP_DRAWABLE (new_layer)->height,
width, height,
TRUE);
if ((tile_manager_bpp (tiles) == 4 &&
......@@ -1458,15 +1468,13 @@ void
gimp_layer_set_opacity (GimpLayer *layer,
gdouble opacity)
{
gint layer_opacity;
g_return_if_fail (GIMP_IS_LAYER (layer));
layer_opacity = (gint) (opacity * 255.999);
opacity = CLAMP (opacity, GIMP_OPACITY_TRANSPARENT, GIMP_OPACITY_OPAQUE);
if (layer->opacity != layer_opacity)
if (layer->opacity != opacity)
{
layer->opacity = layer_opacity;
layer->opacity = opacity;
g_signal_emit (G_OBJECT (layer), layer_signals[OPACITY_CHANGED], 0);
......@@ -1482,7 +1490,7 @@ gimp_layer_get_opacity (const GimpLayer *layer)
{
g_return_val_if_fail (GIMP_IS_LAYER (layer), GIMP_OPACITY_OPAQUE);
return (gdouble) layer->opacity / 255.0;
return (gdouble) layer->opacity;
}
void
......
......@@ -37,7 +37,7 @@ struct _GimpLayer
{
GimpDrawable parent_instance;
gint opacity; /* layer opacity */
gdouble opacity; /* layer opacity */
GimpLayerModeEffects mode; /* layer combination mode */
gboolean preserve_trans; /* preserve transparency */
......@@ -79,7 +79,7 @@ GimpLayer * gimp_layer_new (GimpImage *gimage,
gint height,
GimpImageType type,
const gchar *name,
gint opacity,
gdouble opacity,
GimpLayerModeEffects mode);
GimpLayer * gimp_layer_copy (const GimpLayer *layer,
GType new_type,
......@@ -88,7 +88,7 @@ GimpLayer * gimp_layer_copy (const GimpLayer *layer,
GimpLayer * gimp_layer_new_from_tiles (TileManager *tiles,
GimpImage *dest_gimage,
const gchar *name,
gint opacity,
gdouble opacity,
GimpLayerModeEffects mode);
GimpLayer * gimp_layer_new_from_drawable (GimpDrawable *drawable,
GimpImage *dest_image);
......
......@@ -167,12 +167,12 @@ gimp_image_projection_bytes (const GimpImage *gimage)
return gimage->proj_bytes;
}
gint
gdouble
gimp_image_projection_opacity (const GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_OPACITY_OPAQUE);
return OPAQUE_OPACITY;
return GIMP_OPACITY_OPAQUE;
}
guchar *
......@@ -597,7 +597,7 @@ gimp_image_construct (GimpImage *gimage,
gimage->height) && /* Covers all. */
(!gimp_drawable_is_indexed (GIMP_DRAWABLE (gimage->layers->data))) &&
/* Not indexed. */
(((GimpLayer *)(gimage->layers->data))->opacity == OPAQUE_OPACITY)
(((GimpLayer *)(gimage->layers->data))->opacity == GIMP_OPACITY_OPAQUE)
/* Opaque */
)
{
......@@ -661,11 +661,17 @@ project_intensity (GimpImage *gimage,
PixelRegion *mask)
{
if (! gimage->construct_flag)
initial_region (src, dest, mask, NULL, layer->opacity,
layer->mode, gimage->visible, INITIAL_INTENSITY);
initial_region (src, dest, mask, NULL,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
INITIAL_INTENSITY);
else
combine_regions (dest, src, dest, mask, NULL, layer->opacity,
layer->mode, gimage->visible, COMBINE_INTEN_A_INTEN);
combine_regions (dest, src, dest, mask, NULL,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
COMBINE_INTEN_A_INTEN);
}
static void
......@@ -676,11 +682,17 @@ project_intensity_alpha (GimpImage *gimage,
PixelRegion *mask)
{
if (! gimage->construct_flag)
initial_region (src, dest, mask, NULL, layer->opacity,
layer->mode, gimage->visible, INITIAL_INTENSITY_ALPHA);
initial_region (src, dest, mask, NULL,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
INITIAL_INTENSITY_ALPHA);
else
combine_regions (dest, src, dest, mask, NULL, layer->opacity,
layer->mode, gimage->visible, COMBINE_INTEN_A_INTEN_A);
combine_regions (dest, src, dest, mask, NULL,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
COMBINE_INTEN_A_INTEN_A);
}
static void
......@@ -690,8 +702,11 @@ project_indexed (GimpImage *gimage,
PixelRegion *dest)
{
if (! gimage->construct_flag)
initial_region (src, dest, NULL, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, INITIAL_INDEXED);
initial_region (src, dest, NULL, gimage->cmap,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
INITIAL_INDEXED);
else
g_warning ("%s: unable to project indexed image.", G_GNUC_PRETTY_FUNCTION);
}
......@@ -704,11 +719,17 @@ project_indexed_alpha (GimpImage *gimage,
PixelRegion *mask)
{
if (! gimage->construct_flag)
initial_region (src, dest, mask, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, INITIAL_INDEXED_ALPHA);
initial_region (src, dest, mask, gimage->cmap,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
INITIAL_INDEXED_ALPHA);
else
combine_regions (dest, src, dest, mask, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, COMBINE_INTEN_A_INDEXED_A);
combine_regions (dest, src, dest, mask, gimage->cmap,
layer->opacity * 255.999,
layer->mode,
gimage->visible,
COMBINE_INTEN_A_INDEXED_A);
}
static void
......@@ -729,15 +750,21 @@ project_channel (GimpImage *gimage,
type = (channel->show_masked) ?
INITIAL_CHANNEL_MASK : INITIAL_CHANNEL_SELECTION;
initial_region (src2, src, NULL, col, opacity,
GIMP_NORMAL_MODE, NULL, type);
initial_region (src2, src, NULL, col,
opacity,
GIMP_NORMAL_MODE,
NULL,
type);
}
else
{
type = (channel->show_masked) ?
COMBINE_INTEN_A_CHANNEL_MASK : COMBINE_INTEN_A_CHANNEL_SELECTION;
combine_regions (src, src2, src, NULL, col, opacity,
GIMP_NORMAL_MODE, NULL, type);
combine_regions (src, src2, src, NULL, col,
opacity,
GIMP_NORMAL_MODE,
NULL,
type);
}
}
......@@ -26,7 +26,7 @@ void gimp_image_projection_free (GimpImage *gimage);
TileManager * gimp_image_projection (GimpImage *gimage);
GimpImageType gimp_image_projection_type (const GimpImage *gimage);
gint gimp_image_projection_bytes (const GimpImage *gimage);
gint gimp_image_projection_opacity (const GimpImage *gimage);
gdouble gimp_image_projection_opacity (const GimpImage *gimage);
guchar * gimp_image_projection_get_color_at (GimpImage *gimage,
gint x,
......
......@@ -795,7 +795,7 @@ render_image_init_info (RenderInfo *info,
if (GIMP_IMAGE_TYPE_HAS_ALPHA (gimp_image_projection_type (shell->gdisp->gimage)))
{
info->alpha =
render_image_init_alpha (gimp_image_projection_opacity (shell->gdisp->gimage));
render_image_init_alpha (gimp_image_projection_opacity (shell->gdisp->gimage) * 255.999);
}
}
......
......@@ -430,9 +430,12 @@ new_layer_query_ok_callback (GtkWidget *widget,
if ((gimage = options->gimage))
{
layer = gimp_layer_new (gimage, options->xsize, options->ysize,
layer = gimp_layer_new (gimage,