Permalink
Browse files

add scale to onChange callback

  • Loading branch information...
1 parent f79b970 commit 5ed48e2f60d4831a102acdc0e02939fe654bc48e Josh Susser and Nate Haugo committed Mar 15, 2014
Showing with 3 additions and 0 deletions.
  1. +2 −0 demo.html
  2. +1 −0 jquery.jWindowCrop.js
View
@@ -48,6 +48,7 @@
<b>Y</b>: <span id="crop_y"></span><br />
<b>W</b>: <span id="crop_w"></span><br />
<b>H</b>: <span id="crop_h"></span><br />
+ <b>S</b>: <span id="crop_s"></span><br />
</div>
<script type="text/javascript">
@@ -64,6 +65,7 @@
$('#crop_y').text(result.cropY);
$('#crop_w').text(result.cropW);
$('#crop_h').text(result.cropH);
+ $('#crop_s').text(result.cropS);
}
});
});
@@ -155,6 +155,7 @@
cropY: Math.round(parseInt(base.$image.css('top'))/base.workingPercent*-1),
cropW: Math.round(base.options.targetWidth/base.workingPercent),
cropH: Math.round(base.options.targetHeight/base.workingPercent),
+ cropS: base.workingPercent,
mustStretch: (base.minPercent > 1)
};
base.options.onChange.call(base.image, base.result);

0 comments on commit 5ed48e2

Please sign in to comment.