-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Styled/Dashed Lines for Shapes #1210
base: main
Are you sure you want to change the base?
Conversation
Yes by using piet's abstraction the core logic is relatively trivially implemented - regarding integration into the UI what about adding another dropdown right above "shaper style"'s where a few predetermined stroke dash styles are available: I am thinking about:
this should give users some option without having complicated settings - for high precision shaping Inkscape is the better choice anyways. What I think is worth discussing : what about offering more complicated choices like mixed dottted and shaped style's? Is that supported by piet currently? |
Good suggestions, things should be kept relatively simple, concerning more complicated choices, they are somewhat possible, for example we could use a StrokeDash ~ [0, 3, 1, 3] and a round LineCap to create a dot-dash line ImplementationTrickier than I initially thought, but still nonetheless possible, here's what I'm currently working on
Also considering adding a simple dashed line to the possible shapes Tricky parts1. piet::StrokeStyle contains piet::StrokeDash
Rc is neither Send nor Sync, which is required for items inside SmoothOptions Currently trying to address this by using the Fragile crate, https://crates.io/crates/fragile, I thinks it's lightweight enough to add to rnote-compose (0 additional dependencies, read through the Fragile implementation, seems sound) 2. consistency Hard to clearly explain this part, so I'll just be using an example:
|
…t one), added new LineStyles
It would be useful if one can also select the brush style for the shape as well. This way one can select the brush Moreover, why only implement styled lines for shapes? It would be useful to draw dashed/dotted lines freehand as well. Maybe this could be implemented similar to how it's done in Xournal++: You can select a pen independently (brush style, size, color, line style) and in the next step you choose if you want to use this selected pen freehand or with a shape. Why should freehand and shapes have different pens? This would also integrate nicely with #1175, because you can select the pen you want, draw something and use the hold feature to convert it to a shape. |
Good point, I'll see what I can do, under the hood pen strokes and shapes uses the same styles, so this might not be too complicated. I've also been thinking about having presets for pens and shapes, as having to switch back and forth within the settings is slightly inconvenient |
The goal of this PR is to allow users to modify the style of shapes, e.g. dashed lines, dotted lines, dotted shapes, etc. Furthermore to unify UI elements of the Shaper menu.
The current implementation could be made more efficient in the future if a pull request to add a sync flag in Piet gets merged.
style_demo.mp4
fixes #852
fixes #375
Cons of the current implementation
Pros of the current implementation