[ts][canvas] Fixed scaled atlases in Canvas renderer. Closes #956

This commit is contained in:
badlogic 2017-08-02 12:47:50 +02:00
parent 83dffa7c64
commit 1b71da6e77
5 changed files with 8 additions and 5 deletions

View File

@ -6523,7 +6523,8 @@ var spine;
ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
ctx.translate(attachment.offset[0], attachment.offset[1]);
ctx.rotate(attachment.rotation * Math.PI / 180);
ctx.scale(attachment.scaleX, attachment.scaleY);
var atlasScale = att.width / w;
ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);
ctx.translate(w / 2, h / 2);
if (attachment.region.rotate) {
var t = w;

File diff suppressed because one or more lines are too long

View File

@ -6523,7 +6523,8 @@ var spine;
ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
ctx.translate(attachment.offset[0], attachment.offset[1]);
ctx.rotate(attachment.rotation * Math.PI / 180);
ctx.scale(attachment.scaleX, attachment.scaleY);
var atlasScale = att.width / w;
ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);
ctx.translate(w / 2, h / 2);
if (attachment.region.rotate) {
var t = w;

File diff suppressed because one or more lines are too long

View File

@ -88,7 +88,8 @@ module spine.canvas {
ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
ctx.translate(attachment.offset[0], attachment.offset[1]);
ctx.rotate(attachment.rotation * Math.PI / 180);
ctx.scale(attachment.scaleX, attachment.scaleY);
let atlasScale = att.width / w;
ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);
ctx.translate(w / 2, h / 2);
if (attachment.region.rotate) {
let t = w;