freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master c168cc3: [raster] Fix disappearing vertical lines (#5


From: Werner LEMBERG
Subject: [freetype2] master c168cc3: [raster] Fix disappearing vertical lines (#54589).
Date: Fri, 21 Sep 2018 05:09:43 -0400 (EDT)

branch: master
commit c168cc3b1bf13e5f3ca77c238dcb204ea821c56d
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [raster] Fix disappearing vertical lines (#54589).
    
    * src/raster/ftraster.c (Vertical_Sweep_Span): Handle special case
    where both left and right outline exactly pass pixel centers.
---
 ChangeLog             |  7 +++++++
 src/raster/ftraster.c | 13 +++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0a15593..b89e838 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-09-21  Werner Lemberg  <address@hidden>
+
+       [raster] Fix disappearing vertical lines (#54589).
+
+       * src/raster/ftraster.c (Vertical_Sweep_Span): Handle special case
+       where both left and right outline exactly pass pixel centers.
+
 2018-09-20  Alexei Podtelezhnikov  <address@hidden>
 
        * src/base/ftobjs.c (ft_glyphslot_reset_bimap): Tiny rounding tweak.
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 0c1d881..23e9f2a 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -2246,13 +2246,18 @@
 
     /* Drop-out control */
 
-    e1 = TRUNC( CEILING( x1 ) );
+    e1 = CEILING( x1 );
+    e2 = FLOOR( x2 );
 
+    /* take care of the special case where both the left */
+    /* and right contour lie exactly on pixel centers    */
     if ( dropOutControl != 2                             &&
-         x2 - x1 - ras.precision <= ras.precision_jitter )
+         x2 - x1 - ras.precision <= ras.precision_jitter &&
+         e1 != x1 && e2 != x2                            )
       e2 = e1;
-    else
-      e2 = TRUNC( FLOOR( x2 ) );
+
+    e1 = TRUNC( e1 );
+    e2 = TRUNC( e2 );
 
     if ( e2 >= 0 && e1 < ras.bWidth )
     {



reply via email to

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