Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Loupe: zoomed Grab cursor only over the photo, so slider cursor wins in side panels

Clément L3e70c0edfe6c
diff --git a/crates/ui-egui/src/panels/detail.rs b/crates/ui-egui/src/panels/detail.rs
index ecbb0e10a..5e5d99aac 100644
--- a/crates/ui-egui/src/panels/detail.rs
+++ b/crates/ui-egui/src/panels/detail.rs
@@ -593,7 +593,10 @@ fn general_interaction(
app.ui.zoom = Zoom::Fit;
}
if zoomed {
- ui.ctx().set_cursor_icon(if resp.dragged() { egui::CursorIcon::Grabbing } else { egui::CursorIcon::Grab });
+ // only over the photo: a panel drawn earlier (sliders) must keep its own cursor
+ if resp.dragged() || resp.hovered() {
+ ui.ctx().set_cursor_icon(if resp.dragged() { egui::CursorIcon::Grabbing } else { egui::CursorIcon::Grab });
+ }
if resp.dragged() {
let dlt = resp.drag_delta();
app.ui.pan.0 = (app.ui.pan.0 - dlt.x / img.width()).clamp(0.0, 1.0);