From 6a45ddf155afbcf57e1d1e86435b5b1375be0675 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Fri, 13 Nov 2026 11:51:51 +0100 Subject: [PATCH] Anchor position guides to the selected layer corner --- crates/midra-layout/src/gui.rs | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/crates/midra-layout/src/gui.rs b/crates/midra-layout/src/gui.rs index ff116cd..d3b71c2 100644 --- a/crates/midra-layout/src/gui.rs +++ b/crates/midra-layout/src/gui.rs @@ -671,29 +671,17 @@ impl Editor { ) * scale; let guide = &screen.painter; let stroke = Stroke::new(1.0_f32, CYAN); - guide.line_segment( - [ - edge + Vec2::new(0.0, 16.0), - Pos2::new(boundary.x, edge.y + 16.0), - ], - stroke, - ); - guide.line_segment( - [ - edge + Vec2::new(14.0, 0.0), - Pos2::new(edge.x + 14.0, boundary.y), - ], - stroke, - ); + guide.line_segment([edge, Pos2::new(boundary.x, edge.y)], stroke); + guide.line_segment([edge, Pos2::new(edge.x, boundary.y)], stroke); guide.text( - Pos2::new((edge.x + boundary.x) / 2.0, edge.y + 22.0), + Pos2::new((edge.x + boundary.x) / 2.0, edge.y + 6.0), Align2::CENTER_TOP, format!("{dx:.2} px"), FontId::proportional(11.0), CYAN, ); guide.text( - Pos2::new(edge.x + 20.0, (edge.y + boundary.y) / 2.0), + Pos2::new(edge.x + 6.0, (edge.y + boundary.y) / 2.0), Align2::LEFT_CENTER, format!("{dy:.2} px"), FontId::proportional(11.0),