Compare the Perspective Crop test label as a string slice

This commit is contained in:
yoriswind committed 2026-12-02 10:04:37 -08:00
1 parent 57fe803772
commit 7be57ed193
1 file changed
+3 -10
@@ -24,10 +24,8 @@ fn hover(h: &mut App, pos: Pos2) {
/// The entire quad is one of the interactive parts declared only when the frame, grid and handles are shown.
fn quad_centres(h: &App) -> Vec<Pos2> {
h.query_all_by_role(Role::Button)
.filter(|node| node.accesskit_node().label() == Some("Whole perspective crop"))
.map(|node| node.rect().center())
.collect()
let quads = h.query_all_by_role(Role::Button).filter(|node| node.accesskit_node().label().as_deref() == Some("Whole perspective crop"));
quads.map(|node| node.rect().center()).collect()
}
#[test]
@@ -87,12 +85,7 @@ fn a_second_view_of_the_same_document_has_no_perspective_crop_quad() -> Result<(
let primary = CanvasHost::main(0);
let secondary = CanvasHost { idx: 0, window: Some(window) };
app.ui.tool = Tool::PerspectiveCrop;
app.canvas_tools.perspective.tool.set(Some([
Point::new(110.0, 90.0),
Point::new(285.0, 90.0),
Point::new(285.0, 217.0),
Point::new(110.0, 217.0),
]));
app.canvas_tools.perspective.tool.set(Some([Point::new(110.0, 90.0), Point::new(285.0, 90.0), Point::new(285.0, 217.0), Point::new(110.0, 217.0)]));
let own = Rect::from_min_size(pos2(20.0, 20.0), vec2(440.0, 340.0));
let copy = own.translate(vec2(480.0, 0.0));