freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master 621556d 2/2: * src/ftlint.c (Explore): Minor im


From: Werner Lemberg
Subject: [freetype2-demos] master 621556d 2/2: * src/ftlint.c (Explore): Minor improvement.
Date: Wed, 13 Dec 2023 23:16:08 -0500 (EST)

branch: master
commit 621556d6dd73069c5e6b2b163e05ba7b4ecea8d7
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/ftlint.c (Explore): Minor improvement.
---
 src/ftlint.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/ftlint.c b/src/ftlint.c
index b7a2020..ad3fc9e 100644
--- a/src/ftlint.c
+++ b/src/ftlint.c
@@ -121,17 +121,17 @@
         v    = outline->points[p];
         d.x -= v.x;
         d.y -= v.y;
-        dx   = SIGN( d.x );
-        dy   = SIGN( d.y );
 
-        if ( dx )
+        if ( d.x )
         {
+          dx  = SIGN( d.x );
           sx += ( dx == -bx );  /* count turns */
           bx  = dx;
         }
 
-        if ( dy )
+        if ( d.y )
         {
+          dy  = SIGN( d.y );
           sy += ( dy == -by );  /* count turns */
           by  = dy;
         }
@@ -139,8 +139,8 @@
         d = v;
       }
 
-      /* count is odd only if initial turn is missed  */
-      /* round it to even and proceed to next contour */
+      /* counts must be even unless the first turn was missed  */
+      /* so make them even and proceed to the next contour     */
       sx += sx & 1;
       sy += sy & 1;
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]