Tests: canvas painted points read the anchor marks as shapes

The canvas tests that look for a mark at a point read circles,
rectangles and lines from the frame. The selection's anchor marks now
paint as one mesh, so painted_points has AnchorMarks paint the shapes
the mesh is made of for its frame.
This commit is contained in:
dotCooCoo committed 2026-12-03 11:37:22 -08:00
1 parent 6cfab55604
commit 5277ec20ef
3 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -1237,4 +1237,4 @@ fn view_key(app: &VectorcraftApp, st: &DocState, tool: &str, tool_points: bool)
}
#[cfg(test)]
mod tests;
pub(super) mod tests;
+1 -1
View File
@@ -946,7 +946,7 @@ thread_local! {
/// Whether `show` draws the anchor marks with `BezierOverlay`, as it did before [`AnchorMarks`].
pub(super) static OVERLAY_MARKS: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
/// Whether [`AnchorMarks`] paints its shapes one by one instead of as a mesh.
pub(super) static RAW_MARKS: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
pub(in crate::canvas) static RAW_MARKS: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
/// How many meshes [`AnchorMarks`] tessellated.
pub(super) static MESHES_BUILT: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
}
+3 -1
View File
@@ -267,10 +267,12 @@ fn the_shown_tool_follows_the_pointer_in_the_frame_it_moves() {
}
/// One headless canvas frame with `events` → the points it paints: the centres of circles and rectangles and the
/// points of lines and paths.
/// points of lines and paths. The selection's anchor marks paint as the shapes their mesh is made of.
fn painted_points(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<egui::Event>) -> Vec<Pos2> {
let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, ..Default::default() };
super::selection::tests::RAW_MARKS.with(|on| on.set(true));
let mut out = ctx.run_ui(raw, |ui| show(app, ui));
super::selection::tests::RAW_MARKS.with(|on| on.set(false));
out.textures_delta.clear();
let mut points = vec![];
for shape in flat_shapes(out.shapes) {