Skip to content

Commit

Permalink
use spine.Color.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
flyover committed Apr 25, 2016
1 parent 78b816c commit baccd2e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions demo/render-ctx2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,17 @@ RenderCtx2D.prototype.drawPose = function(spine_pose, atlas_data) {

switch (slot.blend) {
default:
case 'normal':
case 'normal':
ctx.globalCompositeOperation = 'source-over';
break;
break;
case 'additive':
ctx.globalCompositeOperation = 'lighter';
ctx.globalCompositeOperation = 'lighter';
break;
case 'multiply':
ctx.globalCompositeOperation = 'multiply';
ctx.globalCompositeOperation = 'multiply';
break;
case 'screen':
ctx.globalCompositeOperation = 'screen';
ctx.globalCompositeOperation = 'screen';
break;
}

Expand Down Expand Up @@ -389,7 +389,7 @@ RenderCtx2D.prototype.drawDebugPose = function(spine_pose, atlas_data) {
ctx.closePath();
ctx.strokeStyle = 'white';
ctx.stroke();
ctxDrawPoint(ctx, strColor(bone.color));
ctxDrawPoint(ctx, bone.color.toString());
ctx.scale(1, -1);
ctx.fillText(bone_key, 0, 0);
ctx.restore();
Expand Down Expand Up @@ -479,7 +479,7 @@ RenderCtx2D.prototype.drawDebugData = function(spine_pose, atlas_data) {
ctx.closePath();
ctx.strokeStyle = 'white';
ctx.stroke();
ctxDrawPoint(ctx, strColor(bone.color));
ctxDrawPoint(ctx, bone.color.toString());
ctx.scale(1, -1);
ctx.fillText(bone_key, 0, 0);
ctx.restore();
Expand All @@ -488,10 +488,6 @@ RenderCtx2D.prototype.drawDebugData = function(spine_pose, atlas_data) {
ctxDrawIkConstraints(ctx, spine_pose.data, spine_pose.data.bones);
}

function strColor(color) {
return 'rgba(' + (color.r * 255) + ',' + (color.g * 255) + ',' + (color.b * 255) + ',' + color.a + ')';
}

function ctxApplySpace(ctx, space) {
if (space) {
ctx.translate(space.position.x, space.position.y);
Expand Down

0 comments on commit baccd2e

Please sign in to comment.