Преглед на файлове

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

badlogic преди 8 години
родител
ревизия
1b71da6e77

+ 2 - 1
spine-ts/build/spine-all.js

@@ -6523,7 +6523,8 @@ var spine;
 					ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
 					ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
 					ctx.translate(attachment.offset[0], attachment.offset[1]);
 					ctx.translate(attachment.offset[0], attachment.offset[1]);
 					ctx.rotate(attachment.rotation * Math.PI / 180);
 					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);
 					ctx.translate(w / 2, h / 2);
 					if (attachment.region.rotate) {
 					if (attachment.region.rotate) {
 						var t = w;
 						var t = w;

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
spine-ts/build/spine-all.js.map


+ 2 - 1
spine-ts/build/spine-canvas.js

@@ -6523,7 +6523,8 @@ var spine;
 					ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
 					ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
 					ctx.translate(attachment.offset[0], attachment.offset[1]);
 					ctx.translate(attachment.offset[0], attachment.offset[1]);
 					ctx.rotate(attachment.rotation * Math.PI / 180);
 					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);
 					ctx.translate(w / 2, h / 2);
 					if (attachment.region.rotate) {
 					if (attachment.region.rotate) {
 						var t = w;
 						var t = w;

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
spine-ts/build/spine-canvas.js.map


+ 2 - 1
spine-ts/canvas/src/SkeletonRenderer.ts

@@ -88,7 +88,8 @@ module spine.canvas {
 				ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
 				ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
 				ctx.translate(attachment.offset[0], attachment.offset[1]);
 				ctx.translate(attachment.offset[0], attachment.offset[1]);
 				ctx.rotate(attachment.rotation * Math.PI / 180);
 				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);
 				ctx.translate(w / 2, h / 2);
 				if (attachment.region.rotate) {
 				if (attachment.region.rotate) {
 					let t = w;
 					let t = w;

Някои файлове не бяха показани, защото твърде много файлове са промени