-
Notifications
You must be signed in to change notification settings - Fork 715
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
new(text): Add 'shrink-only' option to 'scaleToFit' #1362
Conversation
Enhancement for #1360 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kyythane thanks for the addition! 🙌
This looks great to me. As mentioned in the issue, the docs will be auto-generated from the types, and the only other possible consideration would be to add a demo of the feature to the https://airbnb.io/visx/text demo (code here). if you don't want to, no sweat just wanted to mention 👍 thanks again!
@@ -151,6 +151,38 @@ describe('<Text />', () => { | |||
expect(transform).toBe('matrix(1.25, 0, 0, 1.25, 0, 0)'); | |||
}); | |||
|
|||
it("Does not scale above 1 when scaleToFit is set to 'shrink-only'", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding tests! looks great 😄
@williaster sorry to bother you if you're busy. I ran into an issue trying to run demos locally.
I don't have a ton of time to dig into what's wrong with my local setup. If you're able to give me some potential leads, I'm happy to follow up on them! Otherwise, if you're willing to verify my demo changes on your end I can commit them. If not, I think it would be best to merge the PR without them? |
hey @kyythane sorry for the delay, I was gone at the end of last week. Sorry you're having issues with the dev setup – that looks like some type of Typescript parsing error so I'd ensure you ran Maybe we can just keep things simple and merge this as is, then if you'd like to post the diff or open a new PR for your demo changes I'm happy to verify them! For now I'll merge this just so we can get it out/you can use it if you need it without more iteration 😄 thanks again for the contribution! |
🎉 This PR is included in version |
🚀 Enhancements
scaleToFit
now takes the option'shrink-only'