divide by scale

This commit is contained in:
nilsding 2014-12-29 16:39:27 +01:00
parent fa16612ba8
commit 338fa5bdb2
1 changed files with 11 additions and 11 deletions

View File

@ -27,17 +27,17 @@
height: side height: side
onChange: (data, action) -> onChange: (data, action) ->
console.log data console.log data
($ '#crop_x').val Math.floor(data.x) ($ '#crop_x').val Math.floor(data.x / data.scale)
($ '#crop_y').val Math.floor(data.y) ($ '#crop_y').val Math.floor(data.y / data.scale)
($ '#crop_w').val Math.floor(data.w) ($ '#crop_w').val Math.floor(data.w / data.scale)
($ '#crop_h').val Math.floor(data.h) ($ '#crop_h').val Math.floor(data.h / data.scale)
# rx = 100 / data.w # rx = 100 / data.w
# ry = 100 / data.h # ry = 100 / data.h
# ($ '#profile-picture-preview').css # ($ '#profile-picture-preview').css
# width: Math.round(rx * preview[0].naturalWidth) + 'px' # width: Math.round(rx * preview[0].naturalWidth) + 'px'
# height: Math.round(ry * preview[0].naturalHeight) + 'px' # height: Math.round(ry * preview[0].naturalHeight) + 'px'
# marginLeft: '-' + Math.round(rx * data.x) + 'px' # marginLeft: '-' + Math.round(rx * data.x) + 'px'
# marginTop: '-' + Math.round(ry * data.y) + 'px' # marginTop: '-' + Math.round(ry * data.y) + 'px'
($ '#cropper-zoom-out').click -> cropper.guillotine 'zoomOut' ($ '#cropper-zoom-out').click -> cropper.guillotine 'zoomOut'
($ '#cropper-zoom-in').click -> cropper.guillotine 'zoomIn' ($ '#cropper-zoom-in').click -> cropper.guillotine 'zoomIn'