Skip to content

Commit e3a0a63

Browse files
committed
Added cursor handling for guide dragging
1 parent bfa7fb0 commit e3a0a63

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

editor/src/messages/tool/tool_messages/select_tool.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,15 @@ impl Fsm for SelectToolFsmState {
12181218
position: viewport_position,
12191219
});
12201220

1221+
let cursor = match direction {
1222+
GuideDirection::Horizontal => MouseCursorIcon::NSResize,
1223+
GuideDirection::Vertical => MouseCursorIcon::EWResize,
1224+
};
1225+
if tool_data.cursor != cursor {
1226+
tool_data.cursor = cursor;
1227+
responses.add(FrontendMessage::UpdateMouseCursor { cursor });
1228+
}
1229+
12211230
SelectToolFsmState::DraggingGuide { guide_id, direction }
12221231
}
12231232
(SelectToolFsmState::DraggingGuide { guide_id, direction }, SelectToolMessage::DragStop { .. }) => {
@@ -1421,6 +1430,13 @@ impl Fsm for SelectToolFsmState {
14211430
cursor = MouseCursorIcon::Move;
14221431
}
14231432

1433+
if let Some((_, direction)) = hit_test_guide(document, input.mouse.position) {
1434+
cursor = match direction {
1435+
GuideDirection::Horizontal => MouseCursorIcon::NSResize,
1436+
GuideDirection::Vertical => MouseCursorIcon::EWResize,
1437+
};
1438+
}
1439+
14241440
// Generate the hover outline
14251441
responses.add(OverlaysMessage::Draw);
14261442

0 commit comments

Comments
 (0)