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

feat: support separate x and y resizeratio #778

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BJvdA
Copy link

@BJvdA BJvdA commented Nov 1, 2022

Proposed solution

If the resizable component is centered, for example you have margin x auto, it resizes twice as fast, so the x ratio should be 2 instead of 1. While y ratio should stay 1. This implements the option to pass an object to resizeRatio of {x?:number; y?:number} so x and y axis can have a different resizeRatio.

Tradeoffs

Users can keep providing a number to resizeRatio if they don't want to use this

Testing Done

Wrap resizable in a container and give it margin-left: auto and margin-right: auto, see how the handle does not stick to the cursor while resizing. Add resizeRatio={{ x: 2 }} and see now the handle moves with the cursor.

@bokuweb
Copy link
Owner

bokuweb commented Nov 11, 2022

@BJvdA Thanks for your PR. Could you please add story and update README?

@byaman
Copy link

byaman commented Aug 22, 2023

Do you have any new information regarding the pull request? It's necessary for my project.

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.

None yet

3 participants