freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 117df36b4: [sfnt] Upgrade stop_offset to FT_Fixed fro


From: Werner Lemberg
Subject: [freetype2] master 117df36b4: [sfnt] Upgrade stop_offset to FT_Fixed from FT_F2Dot14
Date: Wed, 22 Jun 2022 05:33:32 -0400 (EDT)

branch: master
commit 117df36b4c3a5f7850a3789e92ce54d9341673ff
Author: Dominik Röttsches <drott@chromium.org>
Commit: Dominik Röttsches <drott@chromium.org>

    [sfnt] Upgrade stop_offset to FT_Fixed from FT_F2Dot14
---
 include/freetype/ftcolor.h | 5 +++--
 src/sfnt/ttcolr.c          | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/freetype/ftcolor.h b/include/freetype/ftcolor.h
index 3edaee4ec..13285683f 100644
--- a/include/freetype/ftcolor.h
+++ b/include/freetype/ftcolor.h
@@ -592,7 +592,8 @@ FT_BEGIN_HEADER
    *
    * @fields:
    *   stop_offset ::
-   *     The stop offset between 0 and 1 along the gradient.
+   *     The stop offset along the gradient, expressed as a 16.16 fixed-point
+   *     coordinate.
    *
    *   color ::
    *     The color information for this stop, see @FT_ColorIndex.
@@ -604,7 +605,7 @@ FT_BEGIN_HEADER
    */
   typedef struct  FT_ColorStop_
   {
-    FT_F2Dot14     stop_offset;
+    FT_Fixed       stop_offset;
     FT_ColorIndex  color;
 
   } FT_ColorStop;
diff --git a/src/sfnt/ttcolr.c b/src/sfnt/ttcolr.c
index d54231fd6..e02dd060e 100644
--- a/src/sfnt/ttcolr.c
+++ b/src/sfnt/ttcolr.c
@@ -1054,7 +1054,7 @@
     /* Iterator points at first `ColorStop` of `ColorLine`. */
     p = iterator->p;
 
-    color_stop->stop_offset = FT_NEXT_SHORT( p );
+    color_stop->stop_offset = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
 
     color_stop->color.palette_index = FT_NEXT_USHORT( p );
 



reply via email to

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