[lua] Fixed typo in SkeletonJson, closes #893

This commit is contained in:
badlogic 2017-05-08 12:39:16 +02:00
parent eb94d4e1f2
commit 7f864d6bc5
4 changed files with 9012 additions and 9009 deletions

View File

@ -246,7 +246,7 @@ function SkeletonJson.new (attachmentLoader)
-- Linked meshes
for i, linkedMesh in ipairs(self.linkedMeshes) do
local skin = skeletonData.defaultSkin
if linkedMesh.skin then skin = skeletonData.findSkin(linkedMesh.skin) end
if linkedMesh.skin then skin = skeletonData:findSkin(linkedMesh.skin) end
if not skin then error("Skin not found: " .. linkedMesh.skin) end
local parent = skin:getAttachment(linkedMesh.slotIndex, linkedMesh.parent)
if not parent then error("Parent mesh not found: " + linkedMesh.parent) end

View File

@ -7466,10 +7466,13 @@ var spine;
if (element == null)
throw new Error("Element " + elementId + " does not exist");
this.validateConfig(config);
var canvas = this.canvas = document.createElement("canvas");
var existingCanvas = element.children[0];
var canvas = this.canvas = existingCanvas || document.createElement("canvas");
canvas.style.width = "100%";
canvas.style.height = "100%";
if (!existingCanvas) {
element.appendChild(canvas);
}
canvas.width = element.clientWidth;
canvas.height = element.clientHeight;
var webglConfig = { alpha: config.alpha };
@ -7646,10 +7649,10 @@ var spine;
};
SpineWidget.prototype.resize = function () {
var canvas = this.canvas;
var w = canvas.clientWidth;
var h = canvas.clientHeight;
var bounds = this.bounds;
if (canvas.width != w || canvas.height != h) {
var w = bounds.size.x;
var h = bounds.size.y;
if (canvas.width != Math.floor(w) || canvas.height != Math.floor(h)) {
canvas.width = w;
canvas.height = h;
}

File diff suppressed because one or more lines are too long