[ts][canvas] Fixed rendering of rotated atlas regions

This commit is contained in:
badlogic 2017-04-07 14:54:08 +02:00
parent ff98e136a1
commit d520830c5c
6 changed files with 16049 additions and 16037 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -90,6 +90,12 @@ module spine.canvas {
ctx.rotate(attachment.rotation * Math.PI / 180);
ctx.scale(attachment.scaleX, attachment.scaleY);
ctx.translate(w / 2, h / 2);
if (attachment.region.rotate) {
let t = w;
w = h;
h = t;
ctx.rotate(-Math.PI / 2);
}
ctx.scale(1, -1);
ctx.translate(-w / 2, -h / 2);
if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {