Skip to content

Commit

Permalink
fix the order of transformations
Browse files Browse the repository at this point in the history
I got it the other way around..
Also change the test to better catch that.
  • Loading branch information
anthrotype committed Aug 16, 2021
1 parent c195674 commit 2a3747f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/nanoemoji/write_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _update_paint_glyph(paint):
if is_transform(child_paint) and is_gradient(child_paint.paint):
child_paint = child_paint.paint.apply_transform(
Affine2D.compose_ltr(
(reuse_result.transform.inverse(), child_paint.gettransform())
(child_paint.gettransform(), reuse_result.transform.inverse())
)
)
return transformed(
Expand Down
2 changes: 1 addition & 1 deletion tests/transformed_gradient_reuse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions tests/transformed_gradient_reuse.ttx
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@
<Glyph value="e000.0"/>
</Paint>
<Transform>
<xx value="1.0"/>
<xx value="0.5"/>
<yx value="0.0"/>
<xy value="0.0"/>
<yy value="1.0"/>
<dx value="57.42188"/>
<dy value="0.0"/>
<yy value="0.5"/>
<dx value="28.711"/>
<dy value="50.0"/>
</Transform>
</Paint>
</LayerList>
Expand All @@ -158,8 +158,8 @@
<ClipBox Format="1">
<xMin value="8"/>
<yMin value="30"/>
<xMax value="92"/>
<yMax value="58"/>
<xMax value="46"/>
<yMax value="80"/>
</ClipBox>
</Clip>
</ClipList>
Expand Down

0 comments on commit 2a3747f

Please sign in to comment.