From 05f34f857d7addd2b7d21f4a79e82c5c4a4b2bd7 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 17 Nov 2026 08:02:43 +0000 Subject: [PATCH] Vanishing point delete trial: the first plane holds the layer's middle and the click lands on the canvas's middle, whatever zoom the fitted view takes --- crates/imaging/tests/it/vanishing_point.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/imaging/tests/it/vanishing_point.rs b/crates/imaging/tests/it/vanishing_point.rs index 8b5b4e2f6..5f0d69a27 100644 --- a/crates/imaging/tests/it/vanishing_point.rs +++ b/crates/imaging/tests/it/vanishing_point.rs @@ -326,7 +326,7 @@ fn a_command_drag_tears_off_a_plane_and_the_far_edge_sets_depth_or_angle() { #[trial] fn delete_removes_the_plane_and_escape_drops_a_half_plane_first() { let drawn_planes = [ - VanishingPlane::new([[100.0, 50.0], [300.0, 50.0], [300.0, 100.0], [100.0, 100.0]]), + VanishingPlane::new([[300.0, 250.0], [500.0, 250.0], [500.0, 350.0], [300.0, 350.0]]), VanishingPlane::new([[0.0; 2]; 4]), VanishingPlane::new([[0.0; 2]; 4]), ]; @@ -336,9 +336,9 @@ fn delete_removes_the_plane_and_escape_drops_a_half_plane_first() { kept.planes.clone_from(&planes); kept.torn.clone_from(&torn); let (mut fixture, app) = open_with(VanishingTool::EditPlane, kept, Vec::new(), LIMITS); - // Select the first plane by clicking inside it: the layer shows at zoom 1, centred on the canvas. - let layer_middle = Vec2::new(LAYER[0] as f32, LAYER[1] as f32) / 2.0; - let inside_first_plane = at(&fixture, Vec2::new(200.0, 75.0) - layer_middle); + // Select the first plane by clicking inside it: it holds the layer's middle, which the fitted view shows at the + // canvas's middle whatever zoom fits the canvas. + let inside_first_plane = at(&fixture, Vec2::ZERO); click(&mut fixture, inside_first_plane); assert_eq!(with_workspace(&app, |workspace| workspace.editor().selected()), Some(0)); fixture.key(Key::Delete, Modifiers::NONE).settle();