-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add methods to get points with axes #337
Conversation
Good idea!
I did temporarily add similar methods before, but removed them because they weren't totally necessary for that particular PR and I couldn't come up with a good name. I think we should keep them, but maybe we can come up with a better name, because I wouldn't associate the name |
58d0d22
to
dcf494b
Compare
The name was inspired by nalgebra's I deliberately didn't do a find/replace with the |
Am I right that
Why would this be necessary?
SGTM |
I've changed |
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.
Some nits...
Thanks for the review. Comments addressed |
I did give the name of the constructor another thought and I think we should change it. IMO the word let rect = Rectangle::new(Point::new(10, 20), Size::new_filled(10));
// does this create a "filled rectangle"? For this case the let rect = Rectangle::new(Point::new(10, 20), Size::new_square(10)); but Where can I put my 🚲? 😉 |
Yes that's true, in context Ellipse::new(Point::new(10, 20), Size::new_square(10)); The best I can come up with is Can I share your 🔒 for my 🚲? 😁 |
OK, let's just go with that. |
Changes pushed 👍 |
Those |
Thanks! |
Hi! Thank you for helping out with Embedded Graphics development! Please:
CHANGELOG.md
entry in the Unreleased section under the appropriate heading (Added, Fixed, etc) and appropriate crate (embedded-graphics
,simulator
,tinytga
,tinybmp
) if your changes affect the public APIrustfmt
on the project./build.sh
(Linux/macOS only) and make sure it passes. If you use Windows, check that CI passes once you've opened the PR.PR description
Adds
x_axis
andy_axis
methods to get aPoint
orSize
with one dimension set to zero. Some places can already use these, but they would be particularly useful in theRoundedRectangle
PR. Also addsPoint::fill
andSize::fill
which will be less useful but there are a couple of places they can be used. If these are really useless I don't mind removing them.