compress emissions of "mask_changed" and "qmask_changed" across undo

2002-08-22  Michael Natterer  <mitch@gimp.org>

	* app/undo.c: compress emissions of "mask_changed" and
	"qmask_changed" across undo groups.

	* app/core/gimpimage-mask.c: set GIMP_DRAWABLE(mask)->preview_valid
	to FALSE in gimp_image_mask_invalidate(), not in
	gimp_image_mask_push_undo(). Fixes selection preview rendering
	after a mask undo.
This commit is contained in:
Michael Natterer 2002-08-22 10:40:11 +00:00 committed by Michael Natterer
parent b5e38ad1d7
commit c2523d8d63
4 changed files with 55 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2002-08-22 Michael Natterer <mitch@gimp.org>
* app/undo.c: compress emissions of "mask_changed" and
"qmask_changed" across undo groups.
* app/core/gimpimage-mask.c: set GIMP_DRAWABLE(mask)->preview_valid
to FALSE in gimp_image_mask_invalidate(), not in
gimp_image_mask_push_undo(). Fixes selection preview rendering
after a mask undo.
2002-08-22 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-render.c: allocate all temporary

View File

@ -164,6 +164,9 @@ gimp_image_mask_invalidate (GimpImage *gimage)
0, 0,
GIMP_DRAWABLE (layer)->width,
GIMP_DRAWABLE (layer)->height);
/* invalidate the preview */
GIMP_DRAWABLE (mask)->preview_valid = FALSE;
}
@ -417,9 +420,6 @@ gimp_image_mask_push_undo (GimpImage *gimage)
undo_push_mask (gimage, mask);
gimp_image_mask_invalidate (gimage);
/* invalidate the preview */
GIMP_DRAWABLE (mask)->preview_valid = FALSE;
}
void

View File

@ -113,6 +113,8 @@ static gboolean mode_changed = FALSE;
static gboolean size_changed = FALSE;
static gboolean resolution_changed = FALSE;
static gboolean unit_changed = FALSE;
static gboolean mask_changed = FALSE;
static gboolean qmask_changed = FALSE;
static void
@ -388,6 +390,22 @@ pop_stack (GimpImage *gimage,
unit_changed = FALSE;
}
/* If the mask_changed flag was set */
if (mask_changed)
{
gimp_image_mask_changed (gimage);
mask_changed = FALSE;
}
/* If the qmask_changed flag was set */
if (qmask_changed)
{
gimp_image_qmask_changed (gimage);
qmask_changed = FALSE;
}
/* let others know that we just popped an action */
gimp_image_undo_event (gimage,
(state == UNDO)? UNDO_POPPED : UNDO_REDO);
@ -1195,7 +1213,7 @@ undo_pop_image_qmask (GimpImage *gimage,
gimage->qmask_state = data->qmask;
data->qmask = tmp;
gimp_image_qmask_changed (gimage);
qmask_changed = TRUE;
return TRUE;
}
@ -1427,6 +1445,7 @@ undo_pop_mask (GimpImage *gimage,
else
{
mask_undo->channel->boundary_known = FALSE;
GIMP_DRAWABLE (mask_undo->channel)->preview_valid = FALSE;
}
if (mask_undo->tiles)
@ -1456,7 +1475,7 @@ undo_pop_mask (GimpImage *gimage,
if (mask_undo->channel == gimp_image_get_mask (gimage))
{
gimp_image_mask_changed (gimage);
mask_changed = TRUE;
}
else
{

View File

@ -113,6 +113,8 @@ static gboolean mode_changed = FALSE;
static gboolean size_changed = FALSE;
static gboolean resolution_changed = FALSE;
static gboolean unit_changed = FALSE;
static gboolean mask_changed = FALSE;
static gboolean qmask_changed = FALSE;
static void
@ -388,6 +390,22 @@ pop_stack (GimpImage *gimage,
unit_changed = FALSE;
}
/* If the mask_changed flag was set */
if (mask_changed)
{
gimp_image_mask_changed (gimage);
mask_changed = FALSE;
}
/* If the qmask_changed flag was set */
if (qmask_changed)
{
gimp_image_qmask_changed (gimage);
qmask_changed = FALSE;
}
/* let others know that we just popped an action */
gimp_image_undo_event (gimage,
(state == UNDO)? UNDO_POPPED : UNDO_REDO);
@ -1195,7 +1213,7 @@ undo_pop_image_qmask (GimpImage *gimage,
gimage->qmask_state = data->qmask;
data->qmask = tmp;
gimp_image_qmask_changed (gimage);
qmask_changed = TRUE;
return TRUE;
}
@ -1427,6 +1445,7 @@ undo_pop_mask (GimpImage *gimage,
else
{
mask_undo->channel->boundary_known = FALSE;
GIMP_DRAWABLE (mask_undo->channel)->preview_valid = FALSE;
}
if (mask_undo->tiles)
@ -1456,7 +1475,7 @@ undo_pop_mask (GimpImage *gimage,
if (mask_undo->channel == gimp_image_get_mask (gimage))
{
gimp_image_mask_changed (gimage);
mask_changed = TRUE;
}
else
{