mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-19 06:14:03 +00:00
Make it possible to refresh the preview of an undo step.
2004-03-20 Simon Budig <simon@gimp.org> * app/core/gimpundo.[ch]: Make it possible to refresh the preview of an undo step. * app/tools/gimpeditselectiontool.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c: refresh the preview when compressing undos. This ensures that the last preview in the undo history always reflects the current state of the image.
This commit is contained in:
parent
8214f17256
commit
5e47b5a0ed
|
@ -409,3 +409,19 @@ gimp_undo_create_preview_private (GimpUndo *undo)
|
|||
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (undo));
|
||||
}
|
||||
|
||||
void
|
||||
gimp_undo_refresh_preview (GimpUndo *undo)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_UNDO (undo));
|
||||
|
||||
if (undo->preview_idle_id)
|
||||
return;
|
||||
|
||||
if (undo->preview)
|
||||
{
|
||||
temp_buf_free (undo->preview);
|
||||
undo->preview = NULL;
|
||||
gimp_undo_create_preview (undo, FALSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,6 +93,8 @@ void gimp_undo_free (GimpUndo *undo,
|
|||
|
||||
void gimp_undo_create_preview (GimpUndo *undo,
|
||||
gboolean create_now);
|
||||
void gimp_undo_refresh_preview (GimpUndo *undo);
|
||||
|
||||
|
||||
|
||||
#endif /* __GIMP_UNDO_H__ */
|
||||
|
|
|
@ -1239,6 +1239,7 @@ gimp_edit_selection_tool_arrow_key (GimpTool *tool,
|
|||
|
||||
undo = gimp_undo_stack_peek (gdisp->gimage->undo_stack);
|
||||
|
||||
/* compress undo */
|
||||
if (! gimp_undo_stack_peek (gdisp->gimage->redo_stack) &&
|
||||
GIMP_IS_UNDO_STACK (undo) && undo->undo_type == undo_type)
|
||||
{
|
||||
|
@ -1314,6 +1315,8 @@ gimp_edit_selection_tool_arrow_key (GimpTool *tool,
|
|||
|
||||
if (push_undo)
|
||||
gimp_image_undo_group_end (gdisp->gimage);
|
||||
else
|
||||
gimp_undo_refresh_preview (undo);
|
||||
|
||||
gimp_image_flush (gdisp->gimage);
|
||||
}
|
||||
|
|
|
@ -1493,6 +1493,10 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle,
|
|||
|
||||
gimp_image_undo_group_end (gimage);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_undo_refresh_preview (undo);
|
||||
}
|
||||
}
|
||||
|
||||
setter (item, TRUE, FALSE);
|
||||
|
@ -1526,6 +1530,9 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle,
|
|||
push_undo = FALSE;
|
||||
|
||||
setter (item, ! active, push_undo);
|
||||
|
||||
if (!push_undo)
|
||||
gimp_undo_refresh_preview (undo);
|
||||
}
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
|
|
|
@ -820,6 +820,9 @@ gimp_layer_tree_view_paint_mode_menu_callback (GtkWidget *widget,
|
|||
UNBLOCK();
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
|
||||
if (!push_undo)
|
||||
gimp_undo_refresh_preview (undo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -886,6 +889,9 @@ gimp_layer_tree_view_opacity_scale_changed (GtkAdjustment *adjustment,
|
|||
UNBLOCK();
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
|
||||
if (!push_undo)
|
||||
gimp_undo_refresh_preview (undo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue