Skip to content

Commit

Permalink
feat(cursor): change cursor type when a draw item selected
Browse files Browse the repository at this point in the history
  • Loading branch information
kakoc committed Oct 6, 2023
1 parent 33ce9d9 commit d9ed495
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ Hotkeys:
screenshot.on_mouse_pressed();
} else {
screenshot.on_mouse_released();
window.set_cursor_icon(CursorIcon::Default);
}

window.request_redraw();
Expand All @@ -173,10 +174,16 @@ Hotkeys:
} => {
let cursor = screenshot.on_mouse_move(position);

window.set_cursor_icon(cursor);
if cursor != CursorIcon::Default {
window.set_cursor_icon(cursor);
}

if screenshot.is_resizing {
window.request_redraw();
} else if matches!(screenshot.what_resize(), BoundaryResize::None)
&& screenshot.draw_mode.is_none()
{
window.set_cursor_icon(CursorIcon::Default);
}
}

Expand Down Expand Up @@ -233,6 +240,10 @@ Hotkeys:
}
}

if screenshot.draw_mode.is_some() {
window.set_cursor_icon(CursorIcon::Crosshair);
}

window.request_redraw();
}

Expand Down

0 comments on commit d9ed495

Please sign in to comment.