only update the view if there's actually a change.

2005-04-07  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcolorframe.c (gimp_color_frame_set_color): only
	update the view if there's actually a change.
This commit is contained in:
Sven Neumann 2005-04-07 11:15:13 +00:00 committed by Sven Neumann
parent e52c59eff3
commit aeff2f27f7
2 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-04-07 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcolorframe.c (gimp_color_frame_set_color): only
update the view if there's actually a change.
2005-04-07 Sven Neumann <sven@gimp.org>
* libgimpconfig/gimpconfig-utils.[ch]: changed GimpConfig utility

View File

@ -179,6 +179,15 @@ gimp_color_frame_set_color (GimpColorFrame *frame,
g_return_if_fail (GIMP_IS_COLOR_FRAME (frame));
g_return_if_fail (color != NULL);
if (frame->sample_valid &&
frame->sample_type == sample_type &&
frame->color_index == color_index &&
gimp_rgb_distance (&frame->color, color) < 0.0001)
{
frame->color = *color;
return;
}
frame->sample_valid = TRUE;
frame->sample_type = sample_type;
frame->color = *color;