Skip to content

Conversation

@fibek
Copy link

@fibek fibek commented Oct 20, 2024

Pull Request Title:

Implement Pan and Zoom Constraints for SVG Viewer

Description:

This PR addresses issue #143 by implementing the following improvements to enhance the user experience within the SVG viewer:

  1. Pan restrictions: Users can no longer drag the SVG outside its boundaries when the constrainToSVGBounds flag is set to true.
  2. Automatic Fit to Viewer: Calls fitToViewer when the SVG does not fully fit within the viewer.
    • I am open to feedback on this approach; an alternative could be to block all interactions except for zooming in.
  3. Zoom restrictions: Zoom functionality is restricted using fitToViewer, preventing users from excessively zooming out beyond the SVG boundaries.

How to Test

To test these new features:

  1. Run the application with npm run start.
  2. Navigate to StandardViewer.
  3. In Controls, set the constrainToSVGBounds flag to true.

Related Issues:

@SmileHub
Copy link

Looking towards it in new pacakge releases if it works

@wolasss
Copy link
Contributor

wolasss commented Nov 13, 2024

@chrvadala any chance you might have some time to look into it?

@wolasss
Copy link
Contributor

wolasss commented Apr 10, 2025

@chrvadala bump

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.

3 participants