Anchor position guides to the selected layer corner
This commit is contained in:
parent
0d0a7970c4
commit
6a45ddf155
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue