Skip to content

Commit

Permalink
Various bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Feb 5, 2014
1 parent c570829 commit 1e31318
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spine-js/spine.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ spine.Skeleton.prototype = {
/** @param attachmentName May be null. */
setAttachment: function (slotName, attachmentName) {
var slots = this.slots;
for (var i = 0, n = slots.size; i < n; i++) {
for (var i = 0, n = slots.length; i < n; i++) {
var slot = slots[i];
if (slot.data.name == slotName) {
var attachment = null;
Expand All @@ -781,13 +781,13 @@ spine.Skeleton.prototype = {
throw "Slot not found: " + slotName;
},
update: function (delta) {
time += delta;
this.time += delta;
}
};

spine.EventData = function (name) {
this.name = name;
}
};
spine.EventData.prototype = {
intValue: 0,
floatValue: 0,
Expand All @@ -796,7 +796,7 @@ spine.EventData.prototype = {

spine.Event = function (data) {
this.data = data;
}
};
spine.Event.prototype = {
intValue: 0,
floatValue: 0,
Expand Down Expand Up @@ -948,7 +948,7 @@ spine.TrackEntry.prototype = {
timeScale: 1,
mixTime: 0, mixDuration: 0,
onStart: null, onEnd: null, onComplete: null, onEvent: null
}
};

spine.AnimationState = function (stateData) {
this.data = stateData;
Expand Down Expand Up @@ -1236,7 +1236,7 @@ spine.SkeletonJson.prototype = {
} else if (type == spine.AttachmentType.boundingBox) {
var vertices = map["vertices"];
for (var i = 0, n = vertices.length; i < n; i++)
attachment.vertices.push(vertices[i] * scale);
attachment.vertices.push(vertices[i] * this.scale);
}

return attachment;
Expand Down Expand Up @@ -1588,7 +1588,7 @@ spine.AtlasRegion.prototype = {
index: 0,
rotate: false,
splits: null,
pads: null,
pads: null
};

spine.AtlasReader = function (text) {
Expand All @@ -1614,7 +1614,7 @@ spine.AtlasReader.prototype = {
var line = this.readLine();
var colon = line.indexOf(":");
if (colon == -1) throw "Invalid line: " + line;
var i = 0, lastMatch= colon + 1;
var i = 0, lastMatch = colon + 1;
for (; i < 3; i++) {
var comma = line.indexOf(",", lastMatch);
if (comma == -1) {
Expand Down Expand Up @@ -1681,7 +1681,7 @@ spine.SkeletonBounds.prototype = {
if (boundingBox.type != spine.AttachmentType.boundingBox) continue;
boundingBoxes.push(boundingBox);

var poolCount = polygonPool.length;
var poolCount = polygonPool.length, polygon;
if (poolCount > 0) {
polygon = polygonPool[poolCount - 1];
polygonPool.splice(poolCount - 1, 1);
Expand Down Expand Up @@ -1751,7 +1751,7 @@ spine.SkeletonBounds.prototype = {
intersectsSegment: function (x1, y1, x2, y2) {
var polygons = this.polygons;
for (var i = 0, n = polygons.length; i < n; i++)
if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return boundingBoxes[i];
if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i];
return null;
},
/** Returns true if the polygon contains the point. */
Expand Down

0 comments on commit 1e31318

Please sign in to comment.