-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Feature Request: Scrollwheel zoom into point #12
Comments
You are right, this would be nice. In the same idea, when zooming on mobile with 2 fingers, we should also use the center of the 2 points as the zoom origin. This is more complex to compute but it's still doable. Would you like to implement this? |
I started to take a crack earlier, but it may take a while for me to find the time to implement it well. |
I'll try to look into this when I have a bit of time 🙂 |
@MattyBalaam Here's a first try, could you tell me if it matches what you meant? (only wheel is handled in this demo): |
I gave the PR a try and it works great on my mousewheel. Very nice work. |
OK, I'll need to clean the code a bit and at least ensure that the zoom with pinch is still working. I could add the same feature for pinch later. 🙂 |
Actually, I just noticed that my PR works well if you didn't move the image before. If you moved it, then it's not working perfectly. I guess the crop position should be taken in to account as well. |
Ah, yes. you shouldn’t rely on me as a tester that’s for sure. |
No I think it's ready: https://codesandbox.io/s/mj61vp82xp. It also handles mobile zoom too. :) |
Just tried it on desktop and on my Android phone and it works brilliantly. Brilliant job. |
Ok I'll release this later today once I'm on the computer :) |
Close #12 Todo: - [x] handle wheel - [x] handle pinch
Released as v1.4.0: https://github.com/ricardo-ch/react-easy-crop/releases/tag/v1.4.0 |
As a user when I have my mouse cursor over a point on an image I would expect it to zoom into that point as the origin.
The text was updated successfully, but these errors were encountered: