gimp r27968 - in trunk: . app/core



Author: neo
Date: Thu Jan 29 10:02:47 2009
New Revision: 27968
URL: http://svn.gnome.org/viewvc/gimp?rev=27968&view=rev

Log:
2009-01-29  Sven Neumann  <sven gimp org>

	* app/core/gimpchannel-combine.c 
(gimp_channel_combine_ellipse_rect):
	fixed incorrect optimization that caused glitches in the rounded
	corners on the left side of rectangular selections.



Modified:
   trunk/ChangeLog
   trunk/app/core/gimpchannel-combine.c

Modified: trunk/app/core/gimpchannel-combine.c
==============================================================================
--- trunk/app/core/gimpchannel-combine.c	(original)
+++ trunk/app/core/gimpchannel-combine.c	Thu Jan 29 10:02:47 2009
@@ -393,16 +393,17 @@
               xj =  ABS (cur_x + 0.5 - ellipse_center_x);
 
               if (yi < b)
-                xdist = xj - a * sqrt (1 - yi * yi / b_sqr);
+                xdist = xj - a * sqrt (1 - SQR (yi) / b_sqr);
               else
-                xdist = 100.0;  /* anything large will work */
+                xdist = 1000.0;  /* anything large will work */
 
               if (xj < a)
-                ydist = yi - b * sqrt (1 - xj * xj / a_sqr);
+                ydist = yi - b * sqrt (1 - SQR (xj) / a_sqr);
               else
-                ydist = 100.0;  /* anything large will work */
+                ydist = 1000.0;  /* anything large will work */
 
               r = hypot (xdist, ydist);
+
               if (r < 0.001)
                 dist = 0.;
               else
@@ -429,19 +430,21 @@
                 {
                   x_start = cur_x;
                   last_val = val;
+                }
+
+              /*  because we are symetric accross the y axis we can
+               *  skip ahead a bit if we are inside. Do this if we
+               *  have reached a value of 255 OR if we have passed
+               *  the center of the leftmost ellipse.
+               */
+              if ((val == 255 || cur_x >= x + a) && cur_x < x + w / 2)
+                {
+                  x_start = cur_x;
+                  last_val = val = 255;
 
-                  /*  because we are symetric accross the y axis we can
-                   *  skip ahead a bit if we are inside. Do this if we
-                   *  have reached a value of 255 OR if we have passed
-                   *  the center of the leftmost ellipse.
-                   */
-                  if ((val == 255 || cur_x >= x + a) && cur_x < x + w / 2)
-                    {
-                      last_val = val = 255;
-                      cur_x = (ellipse_center_x +
-                               (ellipse_center_x - cur_x) - 1 +
-                               floor (straight_width));
-                    }
+                  cur_x = (ellipse_center_x +
+                           (ellipse_center_x - cur_x) - 1 +
+                           floor (straight_width));
                 }
 
               /* Time to change center? */
@@ -449,7 +452,6 @@
                 {
                   ellipse_center_x = x + a + straight_width;
                 }
-
             }
 
           gimp_channel_combine_segment (mask, op, x_start,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]