Skip to content

Replace react-zoom-pan-pinch with a framework-neutral viewport (fixes #147) #218

Closed

Description

@CameronBrooks11

What

Replace react-zoom-pan-pinch with a framework-neutral pan/zoom viewport in Svelte, retaining the PNG preview contract, and fix the known zoom-clamp bug (#147) in the process.

Why

Removes a React-only dependency and fixes a real viewport bug, without changing the framework and the render format at the same time (the backend image contract stays put).

Where

fiberpath_gui/src/components/canvas/ — VisualizationCanvas.tsx (211), CanvasControls.tsx, LayerScrubber.tsx, CenterCanvas.tsx; hooks/canvas/usePreviewGeneration.ts (111); canvas.css (350).

Scope

  • Reimplement pan / zoom / reset / wheel-zoom with native pointer events + CSS transforms (or a small framework-neutral util) over the <img> preview.
  • Fix GUI bug: plot viewer zoom is clamped to image bounds #147: zoom must scale the full image/viewport, not just the area inside the original image bounds — handle both larger-than-bounds (pan/zoom to overflow) and smaller-than-bounds (zoom in to inspect) cases.
  • Migrate the layer scrubber, canvas controls, and loading / error / empty / warning states.

Acceptance criteria

Notes

Depends on #216. Closes #147. PNG→vector/WebGL rendering is explicitly out of scope (evaluate after parity). Part of #214.

Activity

  1. added
    gui
    on Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions