-
-
Notifications
You must be signed in to change notification settings - Fork 581
Implement fill tool #254
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
Implement fill tool #254
Conversation
Might as well! |
@@ -56,6 +56,24 @@ impl PathStyle { | |||
pub fn new(stroke: Option<Stroke>, fill: Option<Fill>) -> Self { | |||
Self { stroke, fill } | |||
} | |||
pub fn get_fill(&self) -> Option<Fill> { |
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.
please remove the get wherever you see it: https://rust-lang.github.io/api-guidelines/naming.html
our codebase is not yet consistent in that regard but it is something we want to improve on
It seems to me, as if all points have been addressed
Alright, feel free to merge once the ci is done |
* Implement fill tool * Add fill tool shortcut * Add getters and setters to styles * Make fill tool act on the topmost layer clicked * Refactor fill operation * Refactor and unify selection tolerance * Add mark_as_dirty function * Fix getter names
* Implement fill tool * Add fill tool shortcut * Add getters and setters to styles * Make fill tool act on the topmost layer clicked * Refactor fill operation * Refactor and unify selection tolerance * Add mark_as_dirty function * Fix getter names
Closes #152
set_fill
method toFill
Fill
andStroke
for consistency?fill
with a given colorMouseDown
+Lmb
to the Fill tool#[child]
to thetool_message_handler
Fill
click handler, generating aFillLayer
operation with the primary color, targeting a clicked layer (if any)The biggest caveat at the moment is the ad hoc click detection. I'm using
intersects_quad_root
with a small rectangle centered on the mouse. This works (though it gives an extra pixel of padding to the click), but I imagineintersects_point
andintersects_point_root
functions should be implemented in the future (I can open an issue for that if we agree it would be preferred).Also, when multiple layers are returned by
intersects_quad_root
, I am using the first of them. This seems to correspond to the visually lowest layer; should it instead use the last item returned?This change is