Ticket #36318: 36318.2.diff
File 36318.2.diff, 2.0 KB (added by , 8 years ago) |
---|
-
src/wp-includes/js/media/controllers/customize-image-cropper.js
14 14 CustomizeImageCropper = Controller.Cropper.extend({ 15 15 doCrop: function( attachment ) { 16 16 var cropDetails = attachment.get( 'cropDetails' ), 17 control = this.get( 'control' ); 17 control = this.get( 'control' ), 18 ratio = cropDetails.width / cropDetails.height; 18 19 19 if ( ! control.params.flex_width ) { 20 cropDetails.dst_width = control.params.width; 21 } 22 if ( ! control.params.flex_height ) { 23 cropDetails.dst_height = control.params.height; 24 } 20 cropDetails.dst_width = control.params.flex_width ? control.params.height * ratio : control.params.width; 21 cropDetails.dst_height = control.params.flex_height ? control.params.width / ratio : control.params.height; 25 22 26 23 return wp.ajax.post( 'crop-image', { 27 24 wp_customize: 'on', -
src/wp-includes/js/media-views.js
400 400 CustomizeImageCropper = Controller.Cropper.extend({ 401 401 doCrop: function( attachment ) { 402 402 var cropDetails = attachment.get( 'cropDetails' ), 403 control = this.get( 'control' ); 403 control = this.get( 'control' ), 404 ratio = cropDetails.width / cropDetails.height; 404 405 405 if ( ! control.params.flex_width ) { 406 cropDetails.dst_width = control.params.width; 407 } 408 if ( ! control.params.flex_height ) { 409 cropDetails.dst_height = control.params.height; 410 } 406 cropDetails.dst_width = control.params.flex_width ? control.params.height * ratio : control.params.width; 407 cropDetails.dst_height = control.params.flex_height ? control.params.width / ratio : control.params.height; 411 408 412 409 return wp.ajax.post( 'crop-image', { 413 410 wp_customize: 'on',