use gimp_rgb_distance() for flat color areas. Fixes bug #144786; merged

2004-06-22  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpcolorarea.c (gimp_color_area_set_color): use
	gimp_rgb_distance() for flat color areas. Fixes bug #144786;
	merged from HEAD.
This commit is contained in:
Sven Neumann 2004-06-22 09:30:20 +00:00 committed by Sven Neumann
parent 0cdeabe94c
commit 07b1f8f34b
2 changed files with 21 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2004-06-22 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpcolorarea.c (gimp_color_area_set_color): use
gimp_rgb_distance() for flat color areas. Fixes bug #144786;
merged from HEAD.
2004-06-19 Pedro Gimeno <pggimeno@wanadoo.es>
* tools/pdbgen/pdb/paths.pdb: Fix typos and improve documentation.

View File

@ -297,15 +297,23 @@ gimp_color_area_set_color (GimpColorArea *area,
g_return_if_fail (GIMP_IS_COLOR_AREA (area));
g_return_if_fail (color != NULL);
if (gimp_rgba_distance (&area->color, color) > 0.000001)
if (area->type == GIMP_COLOR_AREA_FLAT)
{
area->color = *color;
area->needs_render = TRUE;
gtk_widget_queue_draw (GTK_WIDGET (area));
g_signal_emit (area, gimp_color_area_signals[COLOR_CHANGED], 0);
if (gimp_rgb_distance (&area->color, color) < 0.000001)
return;
}
else
{
if (gimp_rgba_distance (&area->color, color) < 0.000001)
return;
}
area->color = *color;
area->needs_render = TRUE;
gtk_widget_queue_draw (GTK_WIDGET (area));
g_signal_emit (area, gimp_color_area_signals[COLOR_CHANGED], 0);
}
/**