mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-11 12:54:57 +00:00
Apply review fixes
- crates/ui-egui/src/app/input.rs - crates/ui-egui/src/services.rs
This commit is contained in:
1 parent
8815ef7350
commit
8b1e20fd8f
2 files changed
+2
-1
No files matched your search
@@ -166,6 +166,7 @@ impl DesignApp {
|
||||
/// Where the pointer is in the window, asked of the system ([`crate::Services::pointer`]),
|
||||
/// for files dropped without pointer events: dragged in from another application, they bring
|
||||
/// none. `None` when the system doesn't say or the window's place isn't known.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub(crate) fn system_pointer(&self, ctx: &egui::Context) -> Option<egui::Pos2> {
|
||||
let at = (self.services.pointer.as_ref()?)()?;
|
||||
// The system's points are unscaled; egui's (the window's rect too) are divided by the
|
||||
|
||||
@@ -47,6 +47,6 @@ pub struct Services {
|
||||
/// The pointer's place on the screen, asked when a file is dropped: a file dragged in from
|
||||
/// another application brings no pointer events with it (winit reports none during a drag on
|
||||
/// macOS), so without it a drop can't tell which frame it landed on. `None`: a drop without
|
||||
/// pointer events loads the place cursor.
|
||||
/// pointer events lands in the middle of the view.
|
||||
pub pointer: Option<PointerFn>,
|
||||
}
|
||||
Reference in new issue
Block a user