-
-
Notifications
You must be signed in to change notification settings - Fork 413
feat: shape styling options and easier highlighting #1210
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
|
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 |
merge main
…sing a highlighter brush type that simply changes the alpha as marker doesn't work on pdfs
|
Quick update: my Piet PR has been merged, and I’ve implemented the original idea - adding piet::StrokeStyle directly to SmoothOptions. As for the marker proposal, I tested it, but I don’t think it’s the best solution to the issues mentioned earlier. The preview doesn’t work (Worse, I'm not sure it can work at all), and (as expected) it still draws over text in an imported PDF. Instead, I’m considering adding a 'solid' and 'highlighter' option, where the highlighter would simply adjust the alpha of the current color to make it more transparent. |
|
the |
Yes that would probably be nicer, just to be clear you mean: make Also could I have your thoughts on the following:
|
…e end, I'll try something else later.
… smooth ShaperStyle is active and vice-versa
|
@flxzt In the end I don't think creating and using a highlighter shaper style is worth it as it doesn't fit the style or logic very well, however using a highlight mode toggle is pretty clean, also hiding the "unused" smooth or rough options seems nice (to me at least) as they are the same size |
merged main
… change its alpha value, leaving it transparent
flxzt
left a comment
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.
what about this instead of manually implementing Deserialize ?
|
I only pushed some minor adjustments (serialization with explicit names to avoid accidental breakage in case rust types are renamed), and some cosmetic code changes (builder pattern for piet's StrokeStyle). Looks good though, I'll merge when the CI finished successfully |






This PR introduces new shape styling options and a configurable highlighter brush type (for shapes).
The styling options include:
As for the highlight mode, it simply adjusts the opacity of the active color(s) to a user-defined value.
Finally, this PR also re-arranges the shaper toolbar a bit.
fixes #852
fixes #375
(probably somewhat addresses other highlighting related issues but I am not 100% sure)