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

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.
This commit is contained in:
Sven Neumann
2004-06-22 09:28:35 +00:00
committed by Sven Neumann
parent 95a88ac3ae
commit dd81320e5c
2 changed files with 20 additions and 7 deletions

View File

@ -1,3 +1,8 @@
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.
2004-06-22 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb/fileops.pdb: app/pdb/fileops_cmds.c is a

View File

@ -286,15 +286,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);
}
/**