mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[lua] Fixed typo in SkeletonJson, closes #893
This commit is contained in:
parent
eb94d4e1f2
commit
7f864d6bc5
@ -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
|
||||
|
||||
@ -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
Loading…
x
Reference in New Issue
Block a user