mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts][core] Fix SceneRenderer missing checks.
This commit is contained in:
parent
606a5e5a30
commit
f5d1f99974
@ -473,7 +473,7 @@ export class SceneRenderer implements Disposable {
|
|||||||
canvas.height = h;
|
canvas.height = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resizeMode === ResizeMode.FitClip) {
|
if (resizeMode === ResizeMode.FitClip && worldWidth !== undefined && worldHeight !== undefined) {
|
||||||
let targetRatio = h / w, sourceRatio = worldHeight / worldWidth;
|
let targetRatio = h / w, sourceRatio = worldHeight / worldWidth;
|
||||||
let scale = targetRatio > sourceRatio ? w / worldWidth : h / worldHeight;
|
let scale = targetRatio > sourceRatio ? w / worldWidth : h / worldHeight;
|
||||||
worldWidth *= scale;
|
worldWidth *= scale;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user