From 7cb95c8ab7d29d9ccc265d74a98a63ee3b514b63 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Apr 2023 12:28:00 -0600 Subject: [PATCH] Revert "[VarComposite] Optimize translate()" This reverts commit 6a55e73d6aa9a378789d4101849f1508ac6fff3d. This was wrong. --- src/OT/glyf/VarCompositeGlyph.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/OT/glyf/VarCompositeGlyph.hh b/src/OT/glyf/VarCompositeGlyph.hh index d1f24ce79..4a6be901e 100644 --- a/src/OT/glyf/VarCompositeGlyph.hh +++ b/src/OT/glyf/VarCompositeGlyph.hh @@ -140,8 +140,9 @@ struct VarCompositeGlyphRecord if (!translateX && !translateY) return; - trans.x += translateX; - trans.y += translateY; + // https://github.com/fonttools/fonttools/blob/f66ee05f71c8b57b5f519ee975e95edcd1466e14/Lib/fontTools/misc/transform.py#L213 + float other[6] = {1.f, 0.f, 0.f, 1.f, translateX, translateY}; + transform (matrix, trans, other); } static void scale (float (&matrix)[4], contour_point_t &trans,