Bug 563130 – Hue selection mode does not cross the 0-360 degrees line

2008-12-04  Sven Neumann  <sven@gimp.org>

	Bug 563130 – Hue selection mode does not cross the 0-360 degrees 
line

	* app/core/gimpimage-contiguous-region.c (pixel_difference):
	applied patch from Daniel Hornung.


svn path=/trunk/; revision=27764
This commit is contained in:
Sven Neumann 2008-12-04 20:58:50 +00:00 committed by Sven Neumann
parent 073b8ab9d5
commit 73eccd7a22
2 changed files with 34 additions and 19 deletions

View file

@ -1,3 +1,10 @@
2008-12-04 Sven Neumann <sven@gimp.org>
Bug 563130 Hue selection mode does not cross the 0-360 degrees line
* app/core/gimpimage-contiguous-region.c (pixel_difference):
applied patch from Daniel Hornung.
2008-12-04 Martin Nordholts <martinn@svn.gnome.org>
Bug 563179 Scrollbars not resized when we extend the canvas size

View file

@ -387,7 +387,15 @@ pixel_difference (const guchar *col1,
bv2 = (gint) col2[2];
gimp_rgb_to_hsv_int (&av0, &av1, &av2);
gimp_rgb_to_hsv_int (&bv0, &bv1, &bv2);
max = abs (av0 - bv0);
/* wrap around candidates for the actual distance */
{
gint dist1 = abs (av0 - bv0);
gint dist2 = abs (av0 - 360 - bv0);
gint dist3 = abs (av0 - bv0 + 360);
max = MIN (dist1, dist2);
if (max > dist3)
max = dist3;
}
break;
case GIMP_SELECT_CRITERION_S: