freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] anuj-distance-field daf348a 3/4: * src/sdf/ftbsdf.c (compare


From: Anuj Verma
Subject: [freetype2] anuj-distance-field daf348a 3/4: * src/sdf/ftbsdf.c (compare_neighbor): Fix bug.
Date: Sat, 1 Aug 2020 08:51:45 -0400 (EDT)

branch: anuj-distance-field
commit daf348ae4d091b0a06f1488b76360849431afa3b
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: Anuj Verma <anujv@iitbhilai.ac.in>

    * src/sdf/ftbsdf.c (compare_neighbor): Fix bug.
---
 [GSoC]ChangeLog  |  4 ++++
 src/sdf/ftbsdf.c | 10 ++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/[GSoC]ChangeLog b/[GSoC]ChangeLog
index 2e77c56..c790cba 100644
--- a/[GSoC]ChangeLog
+++ b/[GSoC]ChangeLog
@@ -1,5 +1,9 @@
 2020-08-1  Anuj Verma  <anujv@iitbhilai.ac.in>
 
+       * src/sdf/ftbsdf.c (compare_neighbor): Fix bug.
+
+2020-08-1  Anuj Verma  <anujv@iitbhilai.ac.in>
+
        [sdf -> bsdf] Optimized a bit.
 
        * src/sdf/ftbsdf.c (ED: sign => alpha): Renamed sign
diff --git a/src/sdf/ftbsdf.c b/src/sdf/ftbsdf.c
index dd05052..73f63dc 100644
--- a/src/sdf/ftbsdf.c
+++ b/src/sdf/ftbsdf.c
@@ -214,9 +214,6 @@
     FT_16D16      alphas[9];
 
 
-    if ( x == 41 && y == 72 )
-      gx = 0;
-
     /* Since our spread cannot be 0, this condition */
     /* can never be true.                           */
     if ( x <= 0 || x >= w - 1 ||
@@ -547,9 +544,10 @@
     /* Of course this will be eliminated while using */
     /* squared distances.                            */
 
-    /* Approximate the distance, use 1 to avoid */
-    /* precision errors.                        */
-    dist = to_check->dist + ONE;
+    /* Approximate the distance, use 1 to avoid  */
+    /* precision errors. We subtract because the */
+    /* two directions can be opposite.           */
+    dist = to_check->dist - ONE;
 
     if ( dist < current->dist )
     {



reply via email to

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