andrefarzat / ng-jcrop

Angular directive to jCrop jQuery plugin
GNU General Public License v2.0
101 stars 39 forks source link

Wrong coordinates. #44

Closed naneri closed 8 years ago

naneri commented 8 years ago

I have a strange issue - on some of the images, the width and height coordinates are being divided by the ratio between original image and image in html (lets say I have a 800x480 image, but on the screen it is 225x372 and the max ratio is 2.17, so image coords [4] and [5] are being divided by 2.17). On other images that are also originally larger then the available windows such a problem does not occure - don't know why.

Has anybody encoutered such an issue?

Update:

I have found out - that this happens to images that are larger by one side the the HTML element inside which image resides. So if image is larger by both axis - such an issue does not occure.

Update:

Not sure - but concerning the line 216 in file https://github.com/andrefarzat/ng-jcrop/blob/master/ng-jcrop.js . Isn't it supposed to be && instead of ||?

andrefarzat commented 8 years ago

@naneri Let's add your example (a 800x480 image) to the demo page, so we both can see what would be the better behaviour to it

andrefarzat commented 8 years ago

@naneri just added the example in the demo page : https://github.com/andrefarzat/ng-jcrop/commit/961ee1eb4a6e8c35f9eafa8b7d89144de9547b00 Please, change it to your need and send me a PR :smile_cat:

andrefarzat commented 8 years ago

PR merged :smile_cat: