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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Clément L 2026-10-03 18:12:35 +02:00
parent 7bf24ff856
commit 3e70c0edfe
1 changed files with 4 additions and 1 deletions

View File

@ -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);