api.zoom() doesn't seem to work for certain values #25
Comments
Hmmm some interesting findings: WORKS FOR api.zoom(1.01) DOESN'T WORK api.zoom(1) |
Hi @sugataa, |
Hey, afraid there's still an issue with api.zoomOut, I can't seem to get it to work. api.zoomOut isn't even registering in the api Here's a gist of how I ended up "hacking" it... |
Basically I changed api.zoomIn(factor) back to api.zoom(factor) WORKS to zoomIN -> factor must be bigger than 1 |
I had the same problem and I found the 'bug': the zoom factor is converted twice resulting in a 2x zoom with values close to 1. In Cropper.prototype.setDimensions zoomInFactor and zoomOutFactor are set:
then in Cropper.prototype.bindControls applyZoomIn and applyZoomOut are bound:
in these two functions the zoom factor is converted again, causing the factor 2
To make it work properly I replaced both calls by:
|
Hey bcabanes,
Great directive!
Just having some trouble with the zoom api, it doesn't seem to work for integers less than 3 (including negative numbers).
Ideally, I'd like to pass in zoom(1) or zoom(-1).
See codepen link, try playing around with the settings on the "Zoom API" button.
Codepen Link
The text was updated successfully, but these errors were encountered: