8
0
Pārlūkot izejas kodu

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

Marek Lewandowski 6 gadi atpakaļ
vecāks
revīzija
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, {
 				editor.plugins.get( 'WidgetResizer' ).apply( ret, viewWriter, {
 					getResizeHost( wrapper ) {
 					getResizeHost( wrapper ) {
 						return wrapper.querySelector( 'img' );
 						return wrapper.querySelector( 'img' );
+					},
+					getAspectRatio( resizeHost ) {
+						return resizeHost.naturalWidth / resizeHost.naturalHeight;
 					}
 					}
 				} );
 				} );