[lua][ts] Ported some post 3.5 changes

This commit is contained in:
badlogic 2016-11-01 14:39:43 +01:00
parent d20bcbb0bb
commit bb7e474f7a
4 changed files with 17 additions and 4 deletions

View File

@ -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 ()

View File

@ -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

View File

@ -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 () {

View File

@ -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);
}
}