Browse Source

Internal: use a custom aspect ratio function to promote ratio based on a image's natural width/height.

Marek Lewandowski 6 years ago
parent
commit
a791f9d964
1 changed files with 3 additions and 0 deletions
  1. 3 0
      packages/ckeditor5-image/src/image/imageediting.js

+ 3 - 0
packages/ckeditor5-image/src/image/imageediting.js

@@ -65,6 +65,9 @@ export default class ImageEditing extends Plugin {
 				editor.plugins.get( 'WidgetResizer' ).apply( ret, viewWriter, {
 					getResizeHost( wrapper ) {
 						return wrapper.querySelector( 'img' );
+					},
+					getAspectRatio( resizeHost ) {
+						return resizeHost.naturalWidth / resizeHost.naturalHeight;
 					}
 				} );