Add G/S shortcut handling to Artboard tool#4039
Add G/S shortcut handling to Artboard tool#4039devviktoria wants to merge 1 commit intoGraphiteEditor:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements keyboard shortcuts for grabbing and scaling artboards within the Artboard tool by adding a new GS message and updating the FSM logic. Review feedback highlights that the scaling implementation is incomplete, lacking necessary state initializations and document transactions required for the ResizingBounds state to function correctly. Additionally, it is recommended to remove commented-out code in the message handler.
| } else if input.keyboard.key(scale) && tool_data.selected_artboard.is_some() { | ||
| //tool_data.start_resizing(selected_edges, document, input); | ||
| tool_data.get_snap_candidates(document, input); | ||
| ArtboardToolFsmState::ResizingBounds |
There was a problem hiding this comment.
The scale branch in the GS message handler is missing several critical initializations required for the ResizingBounds state to function correctly. Specifically, it needs to:
- Start a document transaction so the operation can be undone/aborted.
- Initialize
bounding_box_manager.selected_edgesandopposite_pivot. Withoutselected_edges, theresize_artboardfunction (called duringPointerMove) will return early and do nothing. - Call
tool_data.start_resizingto set up the center of transformation and initial location.
Since this is a keyboard shortcut, you might want to default to resizing from the bottom-right corner or similar.
|
|
||
| ArtboardToolFsmState::Dragging | ||
| } else if input.keyboard.key(scale) && tool_data.selected_artboard.is_some() { | ||
| //tool_data.start_resizing(selected_edges, document, input); |
Adds support G/S (grab and scale) keyboard shortcut handling to the Artboard tool.
Closes #4026