Skip to content

feat: add pan and zoom toggle controls with full camera state save/re…#91

Merged
jourdain merged 1 commit intomasterfrom
feature/pan-and-zoom
May 4, 2026
Merged

feat: add pan and zoom toggle controls with full camera state save/re…#91
jourdain merged 1 commit intomasterfrom
feature/pan-and-zoom

Conversation

@patrickoleary
Copy link
Copy Markdown
Member

Adds pan, zoom, and aspect ratio controls to the Viewport Layout toolbar as collapsible toggle groups, with full camera state persistence.

UI Changes

  • Aspect ratio toggle — reveals a slider (0–4, step 0.25) with tick marks
  • Zoom toggle — reveals zoom in/out buttons
  • Pan toggle — reveals up/down/left/right pan buttons
  • Reset view button resets camera to default
  • Toggles are mutually exclusive — activating one collapses the others
  • Active groups highlighted with a subtle background
  • Toolbar streamlined: removed "Viewport layout" label, grouped/uniform is now icon-only with tooltip, Size is icon-only with tooltip, hotkey badge removed
  • Keyboard shortcut z for reset and g for grouped still work

Everything collapses. I think the dimension sliders would look a lot better this way too.

viewport-toolbar

Camera State Save/Restore
State export now saves the full VTK camera configuration:

  • zoom (ParallelScale)
  • position (camera position)
  • focal_point (camera focal point)
  • view_up (camera up direction)
  • clipping_range (near/far clipping planes)

API Simplification

  • Replaced zoom_in/zoom_out with zoom(factor)
  • Replaced pan_up/pan_down/pan_left/pan_right with pan(dx, dy)
  • Button-specific logic (direction, factor) lives in toolbar lambdas

closes #80

…store

- Add zoom(factor) and pan(dx, dy) methods to both view managers
- Add aspect ratio, zoom, and pan toggle groups to Layout toolbar with background highlight
- Add reset view button with render fix
- Save/restore full camera state (zoom, position, focal point, view up, clipping range)
- Streamline toolbar: remove label, icon-only grouped/size buttons with tooltips
- Aspect ratio slider with 0.25 step ticks (0-4 range)
@jourdain jourdain merged commit 5c2319a into master May 4, 2026
1 check passed
@jourdain jourdain deleted the feature/pan-and-zoom branch May 4, 2026 18:27
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.

Disable view interaction and add zoom-in/out

3 participants