Răsfoiți Sursa

[lua][ts] Ported some post 3.5 changes

badlogic 8 ani în urmă
părinte
comite
bb7e474f7a

+ 7 - 1
spine-lua/SkeletonBounds.lua

@@ -72,7 +72,13 @@ function SkeletonBounds:update (skeleton, updateAabb)
 		end
 	end
 
-	if updateAabb then self:aabbCompute() end
+	if updateAabb then 
+    self:aabbCompute()
+  else
+    self.minX = 9999999
+    self.minY = 9999999
+    self.maxX = -9999999
+    self.maxY = -9999999
 end
 
 function SkeletonBounds:aabbCompute ()

+ 1 - 1
spine-lua/SkeletonJson.lua

@@ -261,7 +261,7 @@ function SkeletonJson.new (attachmentLoader)
 				local data = EventData.new(eventName)
 				data.intValue = getValue(eventMap, "int", 0)
 				data.floatValue = getValue(eventMap, "float", 0)
-				data.stringValue = getValue(eventMap, "string", nil)
+				data.stringValue = getValue(eventMap, "string", "")
 				table_insert(skeletonData.events, data)
 			end
 		end

+ 8 - 1
spine-ts/core/src/SkeletonBounds.ts

@@ -65,7 +65,14 @@ module spine {
 				}
 			}
 
-			if (updateAabb) this.aabbCompute();
+			if (updateAabb) { 
+				this.aabbCompute();
+			} else {
+				this.minX = Number.POSITIVE_INFINITY;
+				this.minY = Number.POSITIVE_INFINITY;
+				this.maxX = Number.NEGATIVE_INFINITY;
+				this.maxY = Number.NEGATIVE_INFINITY;
+			}
 		}
 
 		aabbCompute () {

+ 1 - 1
spine-ts/core/src/SkeletonJson.ts

@@ -229,7 +229,7 @@ module spine {
 					let data = new EventData(eventName);
 					data.intValue = this.getValue(eventMap, "int", 0);
 					data.floatValue = this.getValue(eventMap, "float", 0);
-					data.stringValue = this.getValue(eventMap, "string", null);
+					data.stringValue = this.getValue(eventMap, "string", "");
 					skeletonData.events.push(data);
 				}
 			}