Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pattern/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ var Color = Class.extend({
g=r.g; b=r.b; a=r.a; r=r.r;
// One value, array with R,G,B,A values.
} else if (r instanceof Array) {
g=r[1]; b=r[2]; a=r[3]||1; r=r[0];
g=r[1]; b=r[2]; a=r[3] !== undefined ? r[3] : 1; r=r[0];
// No value or null, transparent black.
} else if (r === undefined || r == null) {
r=0; g=0; b=0; a=0;
Expand Down Expand Up @@ -3735,4 +3735,4 @@ this);this.m_=this.mStack_.pop()};function ha(b){var a=0;for(;a<3;a++){var c=0;f
0],[0,0,1]],this.m_),true)};i.transform=function(b,a,c,d,f,h){A(this,y([[b,a,0],[c,d,0],[f,h,1]],this.m_),true)};i.setTransform=function(b,a,c,d,f,h){A(this,[[b,a,0],[c,d,0],[f,h,1]],true)};i.clip=function(){};i.arcTo=function(){};i.createPattern=function(){return new U};function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}D.prototype.addColorStop=function(b,a){a=P(a);this.colors_.push({offset:b,color:a.color,alpha:a.alpha})};function U(){}G_vmlCanvasManager=
M;CanvasRenderingContext2D=H;CanvasGradient=D;CanvasPattern=U})();

}
}
3 changes: 2 additions & 1 deletion test/test_canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ var test_canvas = {
assert(Array.eq(new Color(0,0,0.5).rgba(), [0,0,0.5,1]));
assert(Array.eq(new Color(1,1,1,1).rgba(), [1,1,1,1]));
assert(Array.eq(new Color([1,0,0,1]).rgba(), [1,0,0,1]));
assert(Array.eq(new Color([1,0,0,0]).rgba(), [1,0,0,0]));
assert(Array.eq(new Color(255,255,0,0, {base:255}).rgba(), [1,1,0,0]));
assert(Array.eq(new Color(1,1,0.5,0, {colorspace:HSB}).rgba(), [0.5,0,0,0]));
assert(Array.eq(new Color(new Color(0)).rgba(), [0,0,0,1]));
Expand Down Expand Up @@ -209,4 +210,4 @@ var test_canvas = {
];
}

}
}