Skip to content

Commit

Permalink
made the cursor icon change dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratik Agrawal authored and Pratik Agrawal committed Jan 15, 2025
1 parent e198945 commit 4b6599e
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,6 @@ impl MessageHandler<NavigationMessage, NavigationMessageData<'_>> for Navigation
responses.add(NodeGraphMessage::SetGridAlignedEdges);
}
NavigationMessage::EndCanvasPTZ { abort_transform } => {
if ipp.keyboard.key(Key::Space) {
debug!("space is pressed");
responses.add(FrontendMessage::UpdateMouseCursor { cursor: MouseCursorIcon::Grab });
}
let Some(ptz) = get_ptz_mut(document_ptz, network_interface, graph_view_overlay_open, breadcrumb_network_path) else {
log::error!("Could not get mutable PTZ in EndCanvasPTZ");
return;
Expand Down Expand Up @@ -315,7 +311,12 @@ impl MessageHandler<NavigationMessage, NavigationMessageData<'_>> for Navigation

// Send the final messages to close out the operation
responses.add(BroadcastEvent::CanvasTransformed);
// responses.add(ToolMessage::UpdateCursor);
if ipp.keyboard.key(Key::Space) {
debug!("space is pressed");
responses.add(FrontendMessage::UpdateMouseCursor { cursor: MouseCursorIcon::Grab });
} else {
responses.add(ToolMessage::UpdateCursor);
}
responses.add(ToolMessage::UpdateHints);
responses.add(NavigateToolMessage::End);
}
Expand Down

0 comments on commit 4b6599e

Please sign in to comment.