Add X and Y offset distance overlay while dragging with the Select tool (#2814)

* Add offset overlay to select tool

* Add overlay to Dragging

* Add axis align behavior

* Style changes

* Add trim to string

* reduce code duplication

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Kavin
2025-07-09 10:49:39 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent a40de58c7c
commit e02510303e
4 changed files with 43 additions and 28 deletions
@@ -974,6 +974,14 @@ impl Fsm for SelectToolFsmState {
}
}
if let Self::Dragging { .. } = self {
let quad = Quad::from_box([tool_data.drag_start, tool_data.drag_current]);
let document_start = document.metadata().document_to_viewport.inverse().transform_point2(quad.top_left());
let document_current = document.metadata().document_to_viewport.inverse().transform_point2(quad.bottom_right());
overlay_context.translation_box(document_current - document_start, quad, None);
}
self
}
(_, SelectToolMessage::EditLayer) => {