summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Bridle <bridle.benjamin@gmail.com>2024-08-04 16:44:51 +1200
committerBen Bridle <bridle.benjamin@gmail.com>2024-08-04 16:44:51 +1200
commitf07c3d277406b4338bbe6a3371d58da0da33905f (patch)
tree809adf458d31b2e65d06cdbf19dfe816ef900f0e
parent67d5d2c434db7d6b85d438f263ca51c26715a583 (diff)
downloadbedrock-pc-f07c3d277406b4338bbe6a3371d58da0da33905f.zip
Update cursor callback to latest version of Phosphor
The most recent Phosphor commit c141d8f unified the is_cursor_visible and cursor_icon callbacks.
-rw-r--r--src/emulator.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/emulator.rs b/src/emulator.rs
index ce89002..78abc12 100644
--- a/src/emulator.rs
+++ b/src/emulator.rs
@@ -119,10 +119,13 @@ impl WindowController for BedrockEmulator {
self.fullscreen
}
- fn is_cursor_visible(&self) -> bool {
+ fn cursor(&mut self) -> Option<CursorIcon> {
let pos = self.vm.dev.input.pointer_position;
let dim = self.vm.dev.screen.dimensions;
- pos.x >= dim.width || pos.y >= dim.height
+ match pos.x >= dim.width || pos.y >= dim.height {
+ true => Some(CursorIcon::Default),
+ false => None,
+ }
}
fn pixel_scale(&self) -> NonZeroU32 {