diff --git a/spine-ts/build/spine-canvas.js b/spine-ts/build/spine-canvas.js index 1f67d812d..68d570800 100644 --- a/spine-ts/build/spine-canvas.js +++ b/spine-ts/build/spine-canvas.js @@ -8300,9 +8300,7 @@ var spine; } ctx.scale(1, -1); ctx.translate(-w / 2, -h / 2); - if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { - ctx.globalAlpha = color.a; - } + ctx.globalAlpha = color.a; ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); if (this.debugRendering) ctx.strokeRect(0, 0, w, h); @@ -8348,9 +8346,7 @@ var spine; var color = this.tempColor; color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha); var ctx = this.ctx; - if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { - ctx.globalAlpha = color.a; - } + ctx.globalAlpha = color.a; for (var j = 0; j < triangles.length; j += 3) { var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; @@ -8471,4 +8467,4 @@ var spine; canvas.SkeletonRenderer = SkeletonRenderer; })(canvas = spine.canvas || (spine.canvas = {})); })(spine || (spine = {})); -//# sourceMappingURL=spine-canvas.js.map \ No newline at end of file +//# sourceMappingURL=spine-canvas.js.map diff --git a/spine-ts/canvas/src/SkeletonRenderer.ts b/spine-ts/canvas/src/SkeletonRenderer.ts index 9d4696164..b1aae0873 100644 --- a/spine-ts/canvas/src/SkeletonRenderer.ts +++ b/spine-ts/canvas/src/SkeletonRenderer.ts @@ -99,13 +99,11 @@ module spine.canvas { } ctx.scale(1, -1); ctx.translate(-w / 2, -h / 2); - if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { - ctx.globalAlpha = color.a; - // experimental tinting via compositing, doesn't work - // ctx.globalCompositeOperation = "source-atop"; - // ctx.fillStyle = "rgba(" + (color.r * 255 | 0) + ", " + (color.g * 255 | 0) + ", " + (color.b * 255 | 0) + ", " + color.a + ")"; - // ctx.fillRect(0, 0, w, h); - } + ctx.globalAlpha = color.a; + // experimental tinting via compositing, doesn't work + // ctx.globalCompositeOperation = "source-atop"; + // ctx.fillStyle = "rgba(" + (color.r * 255 | 0) + ", " + (color.g * 255 | 0) + ", " + (color.b * 255 | 0) + ", " + color.a + ")"; + // ctx.fillRect(0, 0, w, h); ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h); if (this.debugRendering) ctx.strokeRect(0, 0, w, h); ctx.restore(); @@ -159,13 +157,11 @@ module spine.canvas { let ctx = this.ctx; - if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) { - ctx.globalAlpha = color.a; - // experimental tinting via compositing, doesn't work - // ctx.globalCompositeOperation = "source-atop"; - // ctx.fillStyle = "rgba(" + (color.r * 255 | 0) + ", " + (color.g * 255 | 0) + ", " + (color.b * 255 | 0) + ", " + color.a + ")"; - // ctx.fillRect(0, 0, w, h); - } + ctx.globalAlpha = color.a; + // experimental tinting via compositing, doesn't work + // ctx.globalCompositeOperation = "source-atop"; + // ctx.fillStyle = "rgba(" + (color.r * 255 | 0) + ", " + (color.g * 255 | 0) + ", " + (color.b * 255 | 0) + ", " + color.a + ")"; + // ctx.fillRect(0, 0, w, h); for (var j = 0; j < triangles.length; j+=3) { let t1 = triangles[j] * 8, t2 = triangles[j+1] * 8, t3 = triangles[j+2] * 8;