[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-30 8e925d582ad 1/2: Fix coordinate transformations in sfnt.c
From: |
Pip Cet |
Subject: |
emacs-30 8e925d582ad 1/2: Fix coordinate transformations in sfnt.c |
Date: |
Sun, 11 Aug 2024 06:33:22 -0400 (EDT) |
branch: emacs-30
commit 8e925d582adba5619ab6f8d2bc7cd6a3a522a28b
Author: Pip Cet <pipcet@protonmail.com>
Commit: Pip Cet <pipcet@protonmail.com>
Fix coordinate transformations in sfnt.c
Backport.
* src/sfnt.c (sfnt_transform_coordinates):
(sfnt_transform_f26dot6): Fix calculation of transformed coordinates in
the very rare case of arbitrary transformation matrices.
---
src/sfnt.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/sfnt.c b/src/sfnt.c
index 34ff6964c31..b235c795ef7 100644
--- a/src/sfnt.c
+++ b/src/sfnt.c
@@ -2578,8 +2578,10 @@ sfnt_transform_coordinates (struct
sfnt_compound_glyph_component *component,
for (i = 0; i < num_coordinates; ++i)
{
- x[i] = m1 * x[i] + m2 * y[i] + m3 * 1;
- y[i] = m4 * x[i] + m5 * y[i] + m6 * 1;
+ sfnt_fixed xi = m1 * x[i] + m2 * y[i] + m3 * 1;
+ sfnt_fixed yi = m4 * x[i] + m5 * y[i] + m6 * 1;
+ x[i] = xi;
+ y[i] = yi;
}
}
@@ -12822,8 +12824,10 @@ sfnt_transform_f26dot6 (struct
sfnt_compound_glyph_component *component,
for (i = 0; i < num_coordinates; ++i)
{
- x[i] = m1 * x[i] + m2 * y[i] + m3 * 1;
- y[i] = m4 * x[i] + m5 * y[i] + m6 * 1;
+ sfnt_f26dot6 xi = m1 * x[i] + m2 * y[i] + m3 * 1;
+ sfnt_f26dot6 yi = m4 * x[i] + m5 * y[i] + m6 * 1;
+ x[i] = xi;
+ y[i] = yi;
}
}