mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[ts][webcomponents] Avoid useless UWT, if skeleton scale does not change.
This commit is contained in:
parent
9ee4d6c40e
commit
85de53624e
@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
var code =
|
var code =
|
||||||
'<script src="https://unpkg.com/@esotericsoftware/spine-player@4.2.*/dist/iife/spine-player.js"></' +
|
'<script src="https://unpkg.com/@esotericsoftware/spine-player@4.3.*/dist/iife/spine-player.js"></' +
|
||||||
'script>\n<link rel="stylesheet" href="https://unpkg.com/@esotericsoftware/spine-player@4.2.*/dist/spine-player.css">\n\n<div id="player-container" style="width: 100%; height: 100vh;"></div>\n\n<script>\nnew spine.SpinePlayer("player-container", {\n skeleton: "http://esotericsoftware.com/files/examples/4.2/spineboy/export/spineboy-pro.json",\n atlas: "http://esotericsoftware.com/files/examples/4.2/spineboy/export/spineboy.atlas",\n premultipliedAlpha: false\n});\n</' +
|
'script>\n<link rel="stylesheet" href="https://unpkg.com/@esotericsoftware/spine-player@4.3.*/dist/spine-player.css">\n\n<div id="player-container" style="width: 100%; height: 100vh;"></div>\n\n<script>\nnew spine.SpinePlayer("player-container", {\n skeleton: "http://esotericsoftware.com/files/examples/4.3/spineboy/export/spineboy-pro.json",\n atlas: "http://esotericsoftware.com/files/examples/4.3/spineboy/export/spineboy.atlas",\n premultipliedAlpha: false\n});\n</' +
|
||||||
"script>".trim();
|
"script>".trim();
|
||||||
spine.SpinePlayerEditor.DEFAULT_CODE = code;
|
spine.SpinePlayerEditor.DEFAULT_CODE = code;
|
||||||
var player = new spine.SpinePlayerEditor(
|
var player = new spine.SpinePlayerEditor(
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -593,8 +593,8 @@ export class SpineWebComponentOverlay extends HTMLElement implements OverlayAttr
|
|||||||
divOriginX = divOriginX - boundsX;
|
divOriginX = divOriginX - boundsX;
|
||||||
divOriginY = divOriginY - boundsY;
|
divOriginY = divOriginY - boundsY;
|
||||||
|
|
||||||
if (fit !== "none") {
|
// scale the skeleton
|
||||||
// scale the skeleton
|
if (fit !== "none" && (skeleton.scaleX !== ratioW || skeleton.scaleY !== ratioH)) {
|
||||||
skeleton.scaleX = ratioW;
|
skeleton.scaleX = ratioW;
|
||||||
skeleton.scaleY = ratioH;
|
skeleton.scaleY = ratioH;
|
||||||
skeleton.updateWorldTransform(Physics.update);
|
skeleton.updateWorldTransform(Physics.update);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user