Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make viewer stay inside SVG boundaries #228

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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?

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