-
-
Notifications
You must be signed in to change notification settings - Fork 980
add arrow shape feature in editor #3343
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
base: master
Are you sure you want to change the base?
add arrow shape feature in editor #3343
Conversation
Signed-off-by: krVatsal <kumarvatsal34@gmail.com>
|
!build |
|
|
I know still a draft, but a arrow node might be something to consider. Like it is done for all other shapes. Thanks for the contribution :) |
|
I haven't read the (draft) PR's code, but what is the tooling doing if it's not controlling an arrow generator node? |
creating a path node |
|
That wouldn't allow the user to parametrically edit the arrow shape. The goal is to add handles to drag its width, length, arrow head's front and back angles, and arrow head width and height. That all has to be written to the parameters of an Arrow node. @krVatsal please be aware of these details for the requirements of this feature. Thank you. |
|
Sure @Keavon |
| let id = PointId::generate(); | ||
| responses.add(GraphOperationMessage::Vector { | ||
| layer, | ||
| modification_type: VectorModificationType::InsertPoint { id, position: pos }, |
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.
Note that this inserts the point in layer space. You said above that you Build arrow in viewport space.
To convert between the viewport and the layer space, you can do something like:
document.metadata().transform_to_viewport(layer).inverse().transform_point2(pos)Alternatively you can set the transform on the layer itself:
responses.add(GraphOperationMessage::TransformSet {
layer,
transform: DAffine2::IDENTITY,
transform_in: TransformIn::Viewport,
skip_rerender: false,
});Note that the line tool is broken and produces offset lines when inside a transformed parent layer. I would recommend that you avoid implementing this bug into you new tool.
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 the help, i have modified it accordingly.
Signed-off-by: krVatsal <kumarvatsal34@gmail.com>
|
|
The arrow position is correct now, I would prefer if it was flipped though, starting at the base and dragging to the tip (just my opinion). And reminder about the requirement of a new arrow node. Just a path node with arrow data generated by the tool is not enough. Take another look at other shape nodes (like
|
Got it, I'll fix it soon! |
Signed-off-by: krVatsal <kumarvatsal34@gmail.com>
|
!build |


Add a new arrow shape tool
Closes #3317