avoid to set the unit property with every size change; only set it if it

2004-03-20  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimppropwidgets.c (gimp_prop_size_entry_callback):
	avoid to set the unit property with every size change; only set it
	if it actually changed.

	* app/core/gimpimage-undo-push.c (gimp_image_undo_push_text_layer):
	allow to pass a GParamSpec that identifies a single text property
	to be changed. In this case, don't store a GimpText object on the
	undo stack but only the changed value.

	* app/tools/gimptexttool.c: use the new undo feature to reduce the
	memory footprint of text undo for the common case.

	* app/text/gimptextlayer.c: changed accordingly.
This commit is contained in:
Sven Neumann
2004-03-20 17:21:48 +00:00
committed by Sven Neumann
parent 9d616282c3
commit 20d03407fe
7 changed files with 151 additions and 36 deletions

View File

@ -1778,6 +1778,18 @@ gimp_prop_size_entry_callback (GimpSizeEntry *sizeentry,
value = gimp_size_entry_get_value (sizeentry, 0);
unit_value = gimp_size_entry_get_unit (sizeentry);
if (unit_param_spec)
{
GimpUnit old_unit;
g_object_get (config,
unit_param_spec->name, &old_unit,
NULL);
if (unit_value == old_unit)
unit_param_spec = NULL;
}
if (G_IS_PARAM_SPEC_INT (param_spec))
{
g_object_set (config,