-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
resizeGroup
not honoring snapThreshold
(choppy resize of selected elements)
#961
Comments
resizeGroup
not honoring snapThreshold
(choppy group resize)resizeGroup
not honoring snapThreshold
(choppy resize of selected elements)
moveable's new version is released. Check it again. |
Thanks for the prompt follow up @daybrush! The choppiness is indeed fixed 🎉 . Though I still don't think resize is working properly. Let me know if this should be a new issue. In this video (same Codepen), you can see that the green rectangle (the one we're using to resize the selection) scales with the grid ✅ . However, the red rectangle does not ❌ , and you end up with the red rectangle with a smaller size than 50px (the grid size). Screen.Recording.2023-07-03.at.8.26.19.p.m.movAlso in this other 2 videos (same Codepen), you can see how, if you select and resize a single element, you can resize it in all directions. However, when you select and resize multiple elements, this no longer becomes possible: Resizing a single element in all directions Screen.Recording.2023-07-03.at.8.27.01.p.m.movResizing multiple elements in all directions Screen.Recording.2023-07-03.at.8.33.37.p.m.movLet me know if you need more clarification and thank you again for such a wonderful library! |
Sorry. group has keepRatio applied and moves with snapThreshold on a group basis. So there are a lot of problems. However, this example may be the best. on("beforeResizeGroup", e => {
const throttle = num => Math.round(num / 50) * 50;
const ratio = e.boundingWidth / e.boundingHeight;
if (ratio < 1) {
const nextBoundingWidth = throttle(e.boundingWidth);
const nextBoundingHeight = nextBoundingWidth / ratio;
e.setSize([nextBoundingWidth, nextBoundingHeight]);
} else {
const nextBoundingHeight = throttle(e.boundingHeight);
const nextBoundingWidth = nextBoundingHeight * ratio;
e.setSize([nextBoundingWidth, nextBoundingHeight]);
}
}). |
Thank you very much for your time, closing this since the choppy resize (original issue) has been fixed 😃 Also, thanks for the suggested code using Here's the new issue I opened to talk about this. |
Environments
Description
When resizing grouped elements, the
width
andheight
coming on the events do not honorsnapThreshold
.On the video below (and on the codepen above), you can see that each individual item can be resized in increments of 50px.
However, when you select both items and resize, it gets choppy.
Screen.Recording.2023-06-27.at.11.38.15.p.m.mov
The text was updated successfully, but these errors were encountered: