View Code? Open in Web Editor
NEW
Angular directive to crop/select an area of an element such as an image. Possible lightweight Jcrop alternative.
Home Page: http://homerjam.github.io/angular-cropify
License: MIT License
JavaScript 20.13%
CSS 50.49%
HTML 29.38%
angular-cropify's Issues
Another great directive :)
Encountered 2 issues implementing this into a page with a vertical scrollbar:
- the mask starts drawing lower than the actual mouse Y position (lower by the value of scrollY)
- moving the mask would cause it to jump upwards by the value of scrollY
Fixed these by editing the following lines:
298: (cropStart function)
var yy = e.pageY - $window.scrollY;
411: (dragStart function)
ctrl.offsets.crop.top = e.offsetY + $window.scrollY;