-
-
Notifications
You must be signed in to change notification settings - Fork 588
Add Rectangle tool controls for transforming existing rectangles #2315
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
Conversation
!build |
|
@Nitish-bot I fixed the transform issue by reusing the code from the text tool PR #2181. |
|
@Keavon is there anything else that needs to be added to this PR? |
@0HyperCube are you concerned about the +250 lines this adds? That feels excessive, but you'd know better than me. There are a couple of concerns that we could save for a followup PR:
I'll wait to hear your thoughts about the potentially excessive line count before proceeding to merge this if that's ok. |
There is some code duplication with the text tool @Keavon. However the transform bounds/cage system is quite verbose to work with and probably needs to be simplified and refactored, which is the main cause of the complexity. I don't really think we should add the whole transform bounds/cage to the rectangle tool as we are just duplicating the functionality of the select tool. I would much prefer to do something like Inkscape where only a couple of handles are displayed that allow you to visually set the values in the node. For example the star tool looks like this: |
@0HyperCube Yep, good call, that's the plan. @mTvare6 is currently working to refactor all the shape drawing tools so they have a single combined implementation with control over which shape is used: polygon and star (plus more primitive geometric shapes in the near future) will be part of the Polygon tool (likely to be renamed the Shape tool) and the most common ones (Line, Rectangle, and Ellipse) will have a dedicated tool icon but will just be a choice of shape like star/polygon/etc. And each individual primitive shape will be in charge of defining its own gizmos, for example similar to the star you posted the screenshot of above. The Rectangle will specify handles for corners and edges which would appear similar to the Transform cage of the Select tool, but is actually just its own gizmo controls similar to the star image above but for rectangles. |
Closes part of #1715