-
Notifications
You must be signed in to change notification settings - Fork 27
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
Scroll zoom effect #20
Comments
|
This is nice! How can you add the zoom center to be the coordinate of the mouse cursor? |
You have to modify the library to do this. I would make a pull request but given that another bugfix pull request has been open since May 29 it looks like the author has abandoned this project.
The following is CoffeeScript and uses jQuery's mousewheel library (https://github.com/jquery/jquery-mousewheel):
|
Thank you a lot! I followed your description and here (http://c-ev.com/zoom/v1my/example/index.html) is the result. It works weird. Clearly I must have done something wrong. Have you ever seen anything like this? |
For the border you have to make the changes in #26 For the weird zooming effect, you have the mousewheel event double-bound. You bind it once in A2 and then once below with this code:
|
I updated the object.coffee (http://c-ev.com/zoom/v1my/src/fabric/controls_extension/object.coffee) and changed the A2 section but no improvement. I guess it is because the border issue is not fixed?! |
Your latest A2 section code is what I am using. |
Try removing this section:
|
That did change something.. Now it doesn't zoom that fast, however, the weird stuff is still present. EDIT: Actually now it is really broken |
|
The same thing.. |
I'm not sure. It looks like it's only ever setting the viewport zoom to 1.1 or to 0.9. I'd try starting with a blank HTML page and add only the JavaScript libraries, the canvas, and the zoom event. This solution worked for me. |
Okay.. will try! Thank you a lot for your time! I owe you a beer! :) Have you ever tried to set up a limit for the zoom so that it would not be possible to zoom out/ in out of the initial view? For instance like here (http://c-ev.com/zoom/v4/example/index.html) if you zoom in the one corner and then zoom out in the opposite corner, then you will start to see the white space. I am trying to merge the "panning" with the "scroll zoom with zoom center" and restriction of the "white space". |
No problem! Let me know if you continue to have the problem with a barebones page, it's weird that it doesn't work as expected. I think it's an interaction with something else, which is why I recommend going to basics to debug. I haven't tried to limit how far the viewport can pan, no, I just include a button that resets the viewport to a default location. |
Sorry for my English.
Is it possible the zoom using the scrolling to move the mouse pointer on the canvas?
The text was updated successfully, but these errors were encountered: