mariofischer/cwcrop — pull request #4 by hhermsen (2014-02-12 11:44:35+00:00)
Title: Replace El.getComputedSize() with El.getSize()

Because #imglayer has a 1px padding and Element.getSize() takes into account borders and padding, elemsize is 2px too big. This results in a this.orig_to_scaled which is (a little) too small, and therefore when selecting the absolute minimum crop area specified by this.options.minsize on an original size image with originalsize specified (where this.orig_to_scaled should be x=1 & y=1), the crop is never made.

This can be easily solved by subtracting 2 pixels (or the CSS detected border+padding) from this.elemsize.x and this.elemsize.y but one could also choose to use Mootools.More Element.getComputedSize() instead. This has the disadvantage of another dependency however. The latter option is given.

Besides I don't see the point in the getOffsetParent() line. Could you clarify?