Skip to content

Disable flatmap tilt by default; respect allow_tilt checkbox in controls#618

Open
Copilot wants to merge 3 commits intomainfrom
copilot/turn-off-flatmap-tilt
Open

Disable flatmap tilt by default; respect allow_tilt checkbox in controls#618
Copilot wants to merge 3 commits intomainfrom
copilot/turn-off-flatmap-tilt

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

The allow_tilt checkbox only toggled a shader uniform but never gated the actual mouse controls. Shift+drag and middle-drag on flatmaps always tilted regardless of the checkbox state.

Changes

  • movement.js: Add allowTilt property (default false) to LandscapeControls. When false and mix == 1:
    • update(): shift/middle-drag dispatches to pan instead of rotate
    • setAltitude(): clamps to 0.1° (flat-on)
    • setAzimuth(): locks to 180° (flat-on)
  • mriview_surface.js: Replace direct uniform setter with setAllowTilt() that sets the uniform and dispatches an allowTilt event
  • mriview.js: Wire allowTilt event from surface to controls (same pattern as mix event)
  • defaults.cfg: Add allow_tilt = false to [webgl_viewopts]

When allow_tilt is checked, the original tilt behavior is fully restored.

Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits April 3, 2026 21:56
When allow_tilt is unchecked (default), shift+click-and-drag and
middle-click-and-drag on the flatmap now pan instead of tilting.
The altitude and azimuth are locked to the flat-on view (0.1 and 180
respectively) when tilt is disabled in flat mode.

The allow_tilt checkbox now properly propagates its state from the
surface uniform to the movement controls via an event dispatch.

Fixes: #517

Agent-Logs-Url: https://github.com/gallantlab/pycortex/sessions/580eced4-5c6c-4b98-904d-148721550d07

Co-authored-by: mvdoc <6150554+mvdoc@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove flatmap tilt functionality in WebGL viewer Disable flatmap tilt by default; respect allow_tilt checkbox in controls Apr 3, 2026
Copilot AI requested a review from mvdoc April 3, 2026 22:01
Copilot finished work on behalf of mvdoc April 3, 2026 22:01
@mvdoc mvdoc requested a review from marklescroart April 3, 2026 22:02
@mvdoc mvdoc marked this pull request as ready for review April 3, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

turn off flatmap tilt

2 participants