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

add preserveAspectRatio parameter to Affine2D.rect_to_rect method #202

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

anthrotype
Copy link
Member

Required for supporting #195

follows algorithm described at https://www.w3.org/TR/SVG/coords.html#ComputingAViewportsTransform

@anthrotype anthrotype force-pushed the rect-to-rect branch 2 times, most recently from 064f074 to cbb0ba9 Compare April 2, 2021 17:27
sx = dst.w / src.w
sy = dst.h / src.h

align, _, meetOrSlice = preserveAspectRatio.lower().strip().partition(" ")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fascinating, never come across partition before

@anthrotype anthrotype merged commit 57679f2 into main Apr 8, 2021
@anthrotype anthrotype deleted the rect-to-rect branch April 8, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants