소스 검색

[ts][canvas] Fixed alpha tinting

badlogic 8 년 전
부모
커밋
7e0df8fa6d
3개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      spine-ts/build/spine-canvas.js
  2. 0 0
      spine-ts/build/spine-canvas.js.map
  3. 1 1
      spine-ts/canvas/src/SkeletonRenderer.ts

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

@@ -260,10 +260,10 @@ var spine;
                     ctx.translate(w / 2, h / 2);
                     ctx.scale(1, -1);
                     ctx.translate(-w / 2, -h / 2);
-                    ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h);
                     if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {
                         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);
                     ctx.restore();

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
spine-ts/build/spine-canvas.js.map


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

@@ -90,7 +90,6 @@ module spine.canvas {
 				ctx.translate(w / 2, h / 2);
 				ctx.scale(1, -1);
 				ctx.translate(-w / 2, -h / 2);
-				ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h);
 				if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {
 					ctx.globalAlpha = color.a;
 					// experimental tinting via compositing, doesn't work
@@ -98,6 +97,7 @@ module spine.canvas {
 					// 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();
 			}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.