Skip to content

Commit 14629ab

Browse files
committed
fix: used options argument instead of this.options
1 parent 82bc403 commit 14629ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/core/image-asset/image-asset-common.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function getAspectSafeDimensions(sourceWidth, sourceHeight, reqWidth, req
4747
}
4848

4949
export function getRequestedImageSize(src: { width: number; height: number }, options: ImageAssetOptions): { width: number; height: number } {
50-
const optionsCopy = { ...(this.options || {}) };
50+
const optionsCopy = { ...(options || {}) };
5151

5252
if (typeof optionsCopy.width === 'string') {
5353
const parsedWidth = parseInt(optionsCopy.width, 10);
@@ -69,8 +69,8 @@ export function getRequestedImageSize(src: { width: number; height: number }, op
6969
}
7070
}
7171

72-
let reqWidth = optionsCopy.width || Math.min(src.width, Screen.mainScreen.widthPixels);
73-
let reqHeight = optionsCopy.height || Math.min(src.height, Screen.mainScreen.heightPixels);
72+
let reqWidth = (optionsCopy.width as number) || Math.min(src.width, Screen.mainScreen.widthPixels);
73+
let reqHeight = (optionsCopy.height as number) || Math.min(src.height, Screen.mainScreen.heightPixels);
7474

7575
if (options && options.keepAspectRatio) {
7676
const safeAspectSize = getAspectSafeDimensions(src.width, src.height, reqWidth, reqHeight);

0 commit comments

Comments
 (0)