-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Plot: Line styles #482
Plot: Line styles #482
Conversation
Tested, and it looks so pretty! I'm sorry I'm so slow to review, and I don't have the time right now either. The dotting and dashing is such a nice feature that it would be nice to expose it outside of the plotter, i.e. add it to In a more distant future the |
@emilk Thanks for the suggestions, I've moved the functions to |
epaint/src/shape.rs
Outdated
points: &[Pos2], | ||
stroke: impl Into<Stroke>, | ||
dash_length: f32, | ||
dash_gap_ratio: f32, |
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.
dash_gap_ratio
deserves an explanation. Length of dash divided by length of the gap between them? it is a bit of a weird API imho. dash_length
and gap_length
seems simpler.
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.
Applied in 5418cd7.
if highlight { | ||
stroke.width *= 2.0; | ||
} | ||
dashes_from_line(&line, *px, stroke, shapes); | ||
let golden_ratio = (5.0_f32.sqrt() - 1.0) / 2.0; // 0.61803398875 |
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.
hint: let golden_ratio = (5.0_f32.sqrt() + 1.0) / 2.0; // 1.61803398875
to avoid the division later :)
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.
True, but made redundant by the other change :)
Closes #474 and closes #524.