mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 12:32:37 +00:00
Honor active components when pasting. Fixes bug #150845:
2006-05-30 Michael Natterer <mitch@gimp.org> Honor active components when pasting. Fixes bug #150845: * app/core/gimplayer-floating-sel.c (floating_sel_composite): don't temporarily set all image components to active while compositing. * app/core/gimpimage.c (gimp_image_set_component_active): relax()/rigor() the floating selection around setting the "active" flag. Also make sure the projection is updated correctly.
This commit is contained in:
parent
e1e77738a0
commit
35c5434b10
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2006-05-30 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Honor active components when pasting. Fixes bug #150845:
|
||||
|
||||
* app/core/gimplayer-floating-sel.c (floating_sel_composite):
|
||||
don't temporarily set all image components to active while
|
||||
compositing.
|
||||
|
||||
* app/core/gimpimage.c (gimp_image_set_component_active):
|
||||
relax()/rigor() the floating selection around setting the "active"
|
||||
flag. Also make sure the projection is updated correctly.
|
||||
|
||||
2006-05-30 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpdataeditor.c (gimp_data_editor_name_activate)
|
||||
|
|
|
@ -1569,8 +1569,22 @@ gimp_image_set_component_active (GimpImage *image,
|
|||
|
||||
if (index != -1 && active != image->active[index])
|
||||
{
|
||||
GimpLayer *floating_sel = gimp_image_floating_sel (image);
|
||||
|
||||
if (floating_sel)
|
||||
floating_sel_relax (floating_sel, FALSE);
|
||||
|
||||
image->active[index] = active ? TRUE : FALSE;
|
||||
|
||||
if (floating_sel)
|
||||
{
|
||||
floating_sel_rigor (floating_sel, FALSE);
|
||||
gimp_drawable_update (GIMP_DRAWABLE (floating_sel),
|
||||
0, 0,
|
||||
GIMP_ITEM (floating_sel)->width,
|
||||
GIMP_ITEM (floating_sel)->height);
|
||||
}
|
||||
|
||||
/* If there is an active channel and we mess with the components,
|
||||
* the active channel gets unset...
|
||||
*/
|
||||
|
|
|
@ -408,14 +408,7 @@ floating_sel_composite (GimpLayer *layer,
|
|||
gint h,
|
||||
gboolean push_undo)
|
||||
{
|
||||
PixelRegion fsPR;
|
||||
GimpImage *image;
|
||||
GimpLayer *d_layer = NULL;
|
||||
gint lock_alpha;
|
||||
gint active[MAX_CHANNELS];
|
||||
gint offx, offy;
|
||||
gint x1, y1, x2, y2;
|
||||
gint i;
|
||||
GimpImage *image;
|
||||
|
||||
g_return_if_fail (GIMP_IS_LAYER (layer));
|
||||
g_return_if_fail (gimp_layer_is_floating_sel (layer));
|
||||
|
@ -441,6 +434,9 @@ floating_sel_composite (GimpLayer *layer,
|
|||
*/
|
||||
if (gimp_item_get_visible (GIMP_ITEM (layer)))
|
||||
{
|
||||
gint offx, offy;
|
||||
gint x1, y1, x2, y2;
|
||||
|
||||
/* Find the minimum area we need to composite -- in image space */
|
||||
gimp_item_offsets (GIMP_ITEM (layer->fs.drawable), &offx, &offy);
|
||||
|
||||
|
@ -460,6 +456,10 @@ floating_sel_composite (GimpLayer *layer,
|
|||
|
||||
if ((x2 - x1) > 0 && (y2 - y1) > 0)
|
||||
{
|
||||
PixelRegion fsPR;
|
||||
GimpLayer *d_layer = NULL;
|
||||
gboolean lock_alpha;
|
||||
|
||||
/* composite the area from the layer to the drawable */
|
||||
pixel_region_init (&fsPR, GIMP_DRAWABLE (layer)->tiles,
|
||||
(x1 - GIMP_ITEM (layer)->offset_x),
|
||||
|
@ -479,17 +479,6 @@ floating_sel_composite (GimpLayer *layer,
|
|||
else
|
||||
lock_alpha = FALSE;
|
||||
|
||||
/* We need to set all image channels to active to make sure that
|
||||
* nothing strange happens while applying the floating selection.
|
||||
* It wouldn't make sense for the floating selection to be affected
|
||||
* by the active image channels.
|
||||
*/
|
||||
for (i = 0; i < MAX_CHANNELS; i++)
|
||||
{
|
||||
active[i] = image->active[i];
|
||||
image->active[i] = 1;
|
||||
}
|
||||
|
||||
/* apply the fs with the undo specified by the value
|
||||
* passed to this function
|
||||
*/
|
||||
|
@ -503,10 +492,6 @@ floating_sel_composite (GimpLayer *layer,
|
|||
/* restore lock alpha */
|
||||
if (lock_alpha)
|
||||
gimp_layer_set_lock_alpha (d_layer, TRUE, FALSE);
|
||||
|
||||
/* restore image active channels */
|
||||
for (i = 0; i < MAX_CHANNELS; i++)
|
||||
image->active[i] = active[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue