소스 검색

ratio fix

Andrew V Butt Sr 4 년 전
부모
커밋
17b6350ce2
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      gui/src/2D/controls/image.ts

+ 2 - 2
gui/src/2D/controls/image.ts

@@ -827,8 +827,8 @@ export class Image extends Control {
         let bottomHeight = this._imageHeight - this._sliceBottom;
         let centerWidth = width - leftWidth - rightWidth;
         let centerHeight = height - topHeight - bottomHeight;
-        let widthFactor = width / this._currentMeasure.width;
-        let heightFactor = height / this._currentMeasure.height;
+        let widthFactor = this._currentMeasure.width / width;
+        let heightFactor = this._currentMeasure.height / height;
         let wfh = widthFactor * 0.5;
         let hfh = heightFactor * 0.5;
         let leftTargetWidth = leftWidth * widthFactor;