matiasgali / guillotine

jQuery plugin to crop images within an area (fully responsive), allowing to drag (touch support), zoom and rotate.
http://guillotine.js.org
326 stars 100 forks source link

Scale multiplied after _init with rotation #17

Closed veewee closed 9 years ago

veewee commented 9 years ago

When the guillotine is initialized with the init which contains 'scale' and 'angle', it is possible that te scale is multiplied:

Example init data:

{angle: 90,  scale: 10, w: 7500, h: 7500}

Wrapper size: 750px * 750px Width: 0.1 Height: 0.1

In the rotate method, the width and height will be smaller then 1, so the _fit method is called. After this method, the scale will be set to 10.

When the rotate method is done, the _zoom method is called. In this method: the factor will be multiplied by 10 again. This will result in a scale of 100.

This leads to unexpected results. I expect the scale to be 10, as specified.