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

disable max zoom? #4

Closed
daniel-hopkins opened this issue Oct 12, 2013 · 6 comments
Closed

disable max zoom? #4

daniel-hopkins opened this issue Oct 12, 2013 · 6 comments
Assignees

Comments

@daniel-hopkins
Copy link

Thanks for this plugin, I have been using it for a while, and even adapted it to use a jquery ui slider instead of the buttons.

An "issue" I'm facing now is if I have { width: 200, height:200 } and the user uploads an image that is <= 200 x 200 the zoom controls do nothing because minPercent is already >= 1.

The other scenario that makes the behavior strange is if the user uploads an image @ 210x210. the click controls only zoom 1px per click (assuming { step:10 } ).

Even though images would get pixelated, I think I'd like to allow them to zoom past minPercent.

Any thoughts on a tweak to allow this?

thanks

@adriengibrat
Copy link
Owner

I've made a few commit to add a new option, and to document it.

Now there is a stretch option, default value is 1, but you can put what float you want greater than 1 (2 allow to zoom up to 2x ...).

In the code, it wasn't minPercent the pb, but the "1" right next to it ;)

And about the click controls only zoom 1px per click... since the commit i couldn't reproduce the bug!

Hope this help. I'm waiting your response to close the issue.

@daniel-hopkins
Copy link
Author

Hi Adrien,
wow, thanks for the quick turnaround.
I think this is a step in the right direction, but the behavior is still not always as expected.
when loading an image larger than the window, it zooms as before
when loading an image the same size as the window, it doesn't zoom at all
when loading an image that is smaller than the window, the minus button zooms in, and the plus button zooms out

I made a fiddle to show you what I mean.
http://jsfiddle.net/szZGe/

btw, there is a typo *stretch

Daniel

@adriengibrat
Copy link
Owner

Hi,

Oops, That's what happend when I code after 2 am when my son wakes me up!

The latest commit should fix this, thanks for the fiddle and typo ;)

Adrien

2013/10/13 niestudio notifications@github.com

Hi Adrien,
wow, thanks for the quick turnaround.
I think this is a step in the right direction, but the behavior is still
not always as expected.
when loading an image larger than the window, it zooms as before
when loading an image the same size as the window, it doesn't zoom at all
when loading an image that is smaller than the window, the minus button
zooms in, and the plus button zooms out

I made a fiddle to show you what I mean.
http://jsfiddle.net/szZGe/

btw, there is a typo *stretch

Daniel


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-26209533
.

@adriengibrat
Copy link
Owner

you can test it, i've updated the js fiddle: http://jsfiddle.net/szZGe/3/

@daniel-hopkins
Copy link
Author

brilliant!
You may want to update the version number too.
Merci

@adriengibrat
Copy link
Owner

merci,
et dire qu'on aurai pu parler en français depuis le début ;)

Adrien

2013/10/13 niestudio notifications@github.com

brilliant!
You may want to update the version number too.
Merci


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-26219232
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants