-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Gradient #3698
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
base: master
Are you sure you want to change the base?
Gradient #3698
Conversation
|
!build |
|
|
!build |
|
|
!build |
|
| let position = position.round() - DVec2::splat(0.5); | ||
|
|
||
| let (radius_offset, stroke_width) = if selected { (1.0, 3.0) } else { (0.0, 1.0) }; | ||
| let radius = MANIPULATOR_GROUP_MARKER_SIZE / 1.5 + 1. + radius_offset; |
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.
This + 1. + part is not included in the _native.rs version of this file.
| self.render_context.begin_path(); | ||
| self.render_context.arc(position.x, position.y, radius, 0., TAU).expect("Failed to draw the circle"); | ||
| let fill = color.unwrap_or(if selected { COLOR_OVERLAY_WHITE } else { COLOR_OVERLAY_BLUE }); | ||
| self.render_context.set_fill_style_str(fill); | ||
| self.render_context.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 integrate this into the closure above, so it uses conditionals to support both the fill and stroke cases, to avoid the code duplication and confusion resulting from it being duplicated.
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.
Also for the two versions of this overall function (web and native), please try to make them both look more consistent with each other by moving the non-shared parts such as one of them involving the definition of a closure to a common place, and doing the common parts (like calling the closure or the other drawing API functions that are equivalent to the closure) in the same place, perhaps with matching comments for each step, so the logical can be followed between the two implementations in a consistent way that has visual anchors lending confidence to the two being traceably equivalent.
Video :
Final.mp4