-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Support rotating of elements #5559
Conversation
feat: rotating is almost done, just need to fix the resizing feat: 🐛 fixed the rotating element rectangle not keeping bounding rectangle fix: 🔥 removed comments Discard changes to dist/index.d.ts Discard changes to dist/css/grapes.min.css Discard changes to src/utils/mixins.ts
Support rotating of elements
Thanks @PaulRill00 this is a nice functionality but I'm against merging it in the core, especially if no one ever asked for it... I'm quite confused as to why you even started this without opening a discussion. Anyway, I'd suggest you refactor this to a plugin, I see this functionality as a perfect usage of Canvas Spots |
Hi @artf, I would argue that at least half of the functionality included in this PR should be included in the core. Especially since the 'absolute' mode is already supported. But - when you set any rotation on the element using the build-in editor, the resize/drag functionality is broken. Then - it only seems like a small addition to also natively support a rotate-handle to make navigating elements easier. As to the reason why I never opened a discussion, is because we use GrapesJS in a project internally and were missing this functionality. So we decided to add it ourselves and then open a PR here. Moving this to a plugin sounds like a lot of work. Maybe you could re-consider implementing this into the core of GrapesJS? We like using the project and would love to make more contributions, but not merging this would mean we'll be using a fork - and therefore a detached-HEAD. |
Sorry @PaulRill00 but in my opinion, just the Rotator file is a HUGE addition to the core, that a lot of people will download and probably won't even use, so for me it's a hard pass for this addition to the core.
I'm not sure about that, what you might find it's some kind of missing API or event that would you allow to bind easily your functionality but here I'm more than open to implementing it if necessary. |
@artf - we're thinking about finally turning this into a proper plugin. |
@PaulRill00 can you please open a new issue/PR showing the problem (reproducible demo) with the Resizer. |
@PaulRill00 is this available as a plugin? |
This PR introduces an option to use a rotate handle to rotate elements.
Next to adding support for rotating, this PR also adds a fix for resizing rotated elements. The element will now 'lock' on the opposite handle when someone stats resizing.
In this PR CSS changes have been made, however, I don't know if we should submit the minified CSS in this PR.