Skip to content

Commit

Permalink
Separate axis align and axis constraint logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mTvare6 authored and Keavon committed Mar 6, 2025
1 parent 146a58b commit b585db7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/src/messages/tool/tool_messages/select_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ impl Fsm for SelectToolFsmState {
tool_data.stop_duplicates(document, responses);
}

tool_data.axis_align = input.keyboard.key(modifier_keys.axis_align) && !axis.is_constraint();
tool_data.axis_align = input.keyboard.key(modifier_keys.axis_align);

// Ignore the non duplicated layers if the current layers have not spawned yet.
let layers_exist = tool_data.layers_dragging.iter().all(|&layer| document.metadata().click_targets(layer).is_some());
Expand All @@ -997,7 +997,7 @@ impl Fsm for SelectToolFsmState {
.map(|bounding_box_manager| bounding_box_manager.transform * Quad::from_box(bounding_box_manager.bounds))
.map_or(DVec2::X, |quad| (quad.top_left() - quad.top_right()).normalize_or(DVec2::X));

let aligned_to_axis = tool_data.axis_align || matches!(axis, Axis::X | Axis::Y);
let aligned_to_axis = tool_data.axis_align || axis.is_constraint();
let mouse_delta = snap_drag(
start,
current,
Expand Down

0 comments on commit b585db7

Please sign in to comment.