8
0
Prechádzať zdrojové kódy

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

Marek Lewandowski 6 rokov pred
rodič
commit
a791f9d964

+ 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;
 					}
 				} );