Kaynağa Gözat

Internal: allow for providing a custom pixel ratio function.

Marek Lewandowski 6 yıl önce
ebeveyn
işleme
4127572930

+ 2 - 1
packages/ckeditor5-widget/src/resizecontext.js

@@ -125,7 +125,8 @@ export default class ResizeContext {
 			y: resizeHost.height
 		};
 
-		this.aspectRatio = this.originalSize.x / this.originalSize.y;
+		this.aspectRatio = this.options.getAspectRatio ?
+			this.options.getAspectRatio( resizeHost ) : this.originalSize.x / this.originalSize.y;
 
 		this.resizeStrategy.begin( domResizeHandler );
 	}