+ ObjectsPerspective.prototype._cropSelection = function() {
+ var mintop = this.$scrolled.offset().top;
+ var maxbottom = mintop + this.$scrolled.height();
+ $(".imgareaselect-outer").each(function(i, e) {
+ var top = parseInt(e.style.top);
+ var height = parseInt(e.style.height);
+ var bottom = top + height;
+ dtop = dheight = 0;
+ if (top < mintop) {
+ dtop += mintop - top;
+ dheight -= dtop;
+ }
+ if (bottom > maxbottom) {
+ dheight -= bottom - maxbottom;
+ }
+ if (dtop) {
+ e.style.top = top + dtop + 'px';
+ }
+ if (dheight) {
+ e.style.height = Math.max(0, height + dheight) + 'px';
+ }
+ });
+ }