Skip to content

Conversation

@jsjgdh
Copy link
Contributor

@jsjgdh jsjgdh commented Jan 29, 2026

Video :

Final.mp4

@Keavon
Copy link
Member

Keavon commented Jan 29, 2026

!build

@github-actions
Copy link

📦 Build Complete for ad20a2a
https://2240a5c8.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Jan 31, 2026

!build

@github-actions
Copy link

📦 Build Complete for 4f4815b
https://744d055c.graphite.pages.dev

@jsjgdh jsjgdh marked this pull request as ready for review January 31, 2026 14:55
@Keavon
Copy link
Member

Keavon commented Jan 31, 2026

!build

@github-actions
Copy link

📦 Build Complete for 33ea7d2
https://9969221f.graphite.pages.dev

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;
Copy link
Member

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.

Comment on lines 488 to 492
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();
Copy link
Member

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants