freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] apodtele-master-patch-68578 74ea5454c 1/2: * src/base/ftoutl


From: Werner Lemberg
Subject: [freetype2] apodtele-master-patch-68578 74ea5454c 1/2: * src/base/ftoutln.c (FT_Outline_Reverse): Anchor first contour points.
Date: Thu, 16 Feb 2023 23:14:18 -0500 (EST)

branch: apodtele-master-patch-68578
commit 74ea5454cc2dee5cbd9c42e63cde8cb26f94beb9
Author: Alex Ringlein <aringlein@figma.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/base/ftoutln.c (FT_Outline_Reverse): Anchor first contour points.
    
    A cubic contour has to always start from an on-point. Therefore, we
    should not swap the first with the last point, which might be off, and
    obtain an invalid contour. This does not matter for conic contours.
    If anything, it also saves one swap there. Fixes #1207.
---
 src/base/ftoutln.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 30ff21ff3..e7ae82e21 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -556,6 +556,10 @@
     {
       last  = outline->contours[n];
 
+      /* keep the first contour point as is and swap points around it */
+      /* to guarantee that the cubic arches stay valid after reverse  */
+      first++;
+
       /* reverse point table */
       {
         FT_Vector*  p = outline->points + first;



reply via email to

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