-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Allow for easing functions on transform #151
Comments
It seems a good feature, we might introduce a new prop to manually enable this extra feature. I was wondering if using a css transition is enough. |
CSS transition unfortunately add a huge delay. I didn't quite understand why. You don't see any animation until you stop panning / zooming. Also CSS transitions don't feel very natural since the momentum/inertia is not calculated. Here's the CSS I used: .pan-zoom-wrapper > svg > g {
transition: transform .1s ease-out;
} A class to determine the transforming |
I recently ran into the same problem with the css transitions. What worked for me was to disable the transition during manual drag and zoom and use a state to add a class to the pan-zoom-wrapper. Its a hack but does the job.
...and enable the class again when using fitToViewer or others
And big thanks for this great library. |
Hi, I would love to get a smooth scrolling by using transitions!
to
works very nice and very smooth for the zoom! But does not really work for pan... |
Feature request
Especially on a 'zoom to fit', it would be pretty neat if you could specificy a
transition
and a maybe atransition-ease-function
.Specifically,
viewer.js
would need to be updated:react-svg-pan-zoom/src/viewer.js
Lines 358 to 360 in 334de3a
One way to support this is with a
transition
prop in seconds and maybe aneaseFunction
prop with option as EASE_IN_OUT, EASE_LINEAR, etc.I can give it a shot, if you want, if you have name a preferred implementation.
The text was updated successfully, but these errors were encountered: