mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 08:48:12 +08:00
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user