Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OverflowErrors when pre-applying transform to radial gradient geometry #448

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "take the min(sx,sy) when decomposing scale transform to minim…
…ise OverflowErrors"

This reverts commit 7d341f5.
  • Loading branch information
anthrotype committed Mar 28, 2023
commit f3c5195c6a14f7faf645801217bcb8d3a8be20dd
4 changes: 1 addition & 3 deletions src/nanoemoji/paint.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,7 @@ def round(self, ndigits: int) -> "PaintLinearGradient":

def _decompose_uniform_transform(transform: Affine2D) -> Tuple[Affine2D, Affine2D]:
scale, remaining_transform = transform.decompose_scale()
# we take the minimum of (sx, sy) to try to minimize the risk of OverflowErrors
# when encoding these to F16Dot16
s = min(*scale.getscale())
s = max(*scale.getscale())
# most transforms will contain a Y-flip component as result of mapping from SVG to
# font coordinate space. Here we keep this negative Y sign as part of the uniform
# transform since it does not affect the circle-ness, and also makes so that the
Expand Down