瀏覽代碼

[libgdx] Fixed additive scaling mixing.

Fixes:
http://esotericsoftware.com/forum/Mixing-two-animations-on-additive-track-problem-16953

Problem was introduced by f4021177f9bc71af93509763232b2401589f7acf which tried to fix:
http://esotericsoftware.com/forum/About-negative-bone-scale-Web-Player-16410
Nathan Sweet 3 年之前
父節點
當前提交
a5b67629c8
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java

+ 4 - 4
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java

@@ -739,8 +739,8 @@ public class Animation {
 						bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha;
 						break;
 					case add:
-						bone.scaleX = (x - bone.data.scaleX) * alpha;
-						bone.scaleY = (y - bone.data.scaleY) * alpha;
+						bone.scaleX += (x - bone.data.scaleX) * alpha;
+						bone.scaleY += (y - bone.data.scaleY) * alpha;
 					}
 				} else {
 					switch (blend) {
@@ -818,7 +818,7 @@ public class Animation {
 						bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bx) * alpha;
 						break;
 					case add:
-						bone.scaleX = (x - bone.data.scaleX) * alpha;
+						bone.scaleX += (x - bone.data.scaleX) * alpha;
 					}
 				} else {
 					switch (blend) {
@@ -891,7 +891,7 @@ public class Animation {
 						bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha;
 						break;
 					case add:
-						bone.scaleY = (y - bone.data.scaleY) * alpha;
+						bone.scaleY += (y - bone.data.scaleY) * alpha;
 					}
 				} else {
 					switch (blend) {