Prechádzať zdrojové kódy

[libgdx] Fixes for JsonRollback (to 3.7).

NathanSweet 6 rokov pred
rodič
commit
c167d8bc52

+ 10 - 4
spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/JsonRollback.java

@@ -135,8 +135,14 @@ public class JsonRollback {
 
 		if (map.isObject() && map.parent.isArray()) { // Probably a key.
 			if (!map.has("time")) map.addChild("time", new JsonValue(0f));
-			if (map.parent.name != null && map.parent.name.equals("rotate") && !map.has("angle"))
-				map.addChild("angle", new JsonValue(0f));
+			if (map.parent.name != null) {
+				if (map.parent.name.equals("rotate") && !map.has("angle"))
+					map.addChild("angle", new JsonValue(0f));
+				else if (map.parent.name.equals("scale")) {
+					if (!map.has("x")) map.addChild("x", new JsonValue(1f));
+					if (!map.has("y")) map.addChild("y", new JsonValue(1f));
+				}
+			}
 		}
 
 		JsonValue curve = map.get("curve");
@@ -149,8 +155,8 @@ public class JsonRollback {
 			curve.addChild(new JsonValue(curve.asFloat()));
 			curve.setType(ValueType.array);
 			curve.addChild(new JsonValue(map.getFloat("c2", 0)));
-			curve.addChild(new JsonValue(map.getFloat("c3", 0)));
-			curve.addChild(new JsonValue(map.getFloat("c4", 0)));
+			curve.addChild(new JsonValue(map.getFloat("c3", 1)));
+			curve.addChild(new JsonValue(map.getFloat("c4", 1)));
 			map.remove("c2");
 			map.remove("c3");
 			map.remove("c4");