瀏覽代碼

[ts][webcomponents] Avoid useless UWT, if skeleton scale does not change.

Davide Tantillo 1 月之前
父節點
當前提交
7247873cf9

+ 2 - 2
spine-ts/spine-player/example/editor.html

@@ -14,8 +14,8 @@
 
   <script>
     var code =
-      '<script src="https://unpkg.com/@esotericsoftware/spine-player@4.2.*/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 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.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();
     spine.SpinePlayerEditor.DEFAULT_CODE = code;
     var player = new spine.SpinePlayerEditor(

File diff suppressed because it is too large
+ 0 - 0
spine-ts/spine-player/example/embedding-binary-example.html


File diff suppressed because it is too large
+ 0 - 0
spine-ts/spine-player/example/embedding-json-example.html


+ 2 - 2
spine-ts/spine-webcomponents/src/SpineWebComponentOverlay.ts

@@ -593,8 +593,8 @@ export class SpineWebComponentOverlay extends HTMLElement implements OverlayAttr
 						divOriginX = divOriginX - boundsX;
 						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.scaleY = ratioH;
 							skeleton.updateWorldTransform(Physics.update);

Some files were not shown because too many files changed in this diff