Repository navigation
Conversation
The wheel delta was negated before the scroll signal, so with Invert Zoom on, ImGui panels and tool scroll handlers scrolled backwards too. Now MouseController negates it only when zooming. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A negative gain (set from code or the config) was clamped back to 0.2 whenever the settings drew the field; the range is now -3..3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pinch updates moved the camera toward an absolute view angle computed from the gesture start, so negating or scaling the wheel delta made it run away from that target. Each update now passes the scale change since the last applied update as a wheel delta; skipped updates are still caught up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores master's Invert Zoom, touchpad and Zoom Gain code; ImGuiMenu negates the inverted wheel delta back before giving it to ImGui, so with Invert Zoom on, ImGui windows scroll in the normal direction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A negative gain (set from code or the config) was clamped back to 0.2 whenever the settings drew the field; the range is now -3..3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fedr
left a comment
There was a problem hiding this comment.
Minor, older than this PR but from the same cause: scrollForce is applied in Viewer::mouseScroll, so Zoom Gain also scales ImGui scroll speed and every other mouseScrollSignal listener. It could move into MouseController::mouseScroll_ together with the inversion (see the inline comment).
| // allow ImGui to process the scroll exclusively | ||
| ImGui_ImplGlfw_ScrollCallback( viewer->window, 0.f, delta_y ); | ||
| // allow ImGui to process the scroll exclusively; Invert Zoom must not invert scrolling of ImGui windows | ||
| ImGui_ImplGlfw_ScrollCallback( viewer->window, 0.f, viewer->mouseController().isZoomInverted() ? -delta_y : delta_y ); |
There was a problem hiding this comment.
This undoes the flip for one listener only. The flip happens where the events come in (glfw_mouse_scroll in MRViewer.cpp and TouchpadController::Handler::mouseScroll), so every mouseScrollSignal listener gets the inverted delta:
- other listeners that use the wheel for something besides zoom (e.g. a tool changing a brush radius on Ctrl+wheel) are still reversed with Invert Zoom on;
- inputs that never went through the flip (touchpad pinch via
TouchpadController::touchpadZoomGestureUpdate_, MCPmouseScroll) now scroll ImGui windows backwards when Invert Zoom is on.
Suggest instead: apply the inversion in MouseController::mouseScroll_, the only listener that zooms, and remove it from glfw_mouse_scroll and TouchpadController::Handler::mouseScroll. Then this hunk is not needed. Pinch would become inverted too; if that is unwanted, touchpadZoomGestureUpdate_ can compensate, or call the zoom directly instead of going through viewer.mouseScroll.
There was a problem hiding this comment.
Kept on purpose: the tested touchpad code stays as it is, and Invert Zoom only needs to leave ImGui windows alone, not change other wheel handlers. Moving the flip into MouseController::mouseScroll_ was the first version of this PR. It also inverts pinch, and since touchpadZoomGestureUpdate_ steers toward an absolute view angle, a negated delta runs the angle to the 179.99° limit, so pinch would need rework too. Pinch and MCP scroll over ImGui windows being reversed with Invert Zoom on is noted in the description.
Zoom Gain keeps applying to every scroll event as before; changing its scope is outside this PR. |
ImGuiMenu::onMouseScroll_now negates it back before passing it to ImGui; the zoom and all other scroll handling stay as they are. Scroll that does not go through the inverting wheel path (touchpad pinch, MCP scroll) is now reversed over ImGui windows when Invert Zoom is on.scrollForceset from code or the config was clamped back to 0.2 whenever the field was drawn. The gain still applies to every scroll event as before, so a negative gain also reverses scrolling of ImGui windows.Testing
Generated with Claude Code