rewrote shadow logic. fill and strokes are now both taken into account. shape and shadow opacities now work well together

This commit is contained in:
Eric Rowell
2013-09-26 01:39:50 -07:00
parent 63c6e9eea3
commit 4cf15cedb8
9 changed files with 112 additions and 120 deletions

View File

@@ -147,17 +147,17 @@ suite('Line', function() {
shadowColor: 'black',
shadowBlur: 20,
shadowOffset: 10,
shadowOpacity: 0.3
shadowOpacity: 0.5,
draggable: true
});
layer.add(line);
stage.add(layer);
var trace = layer.getContext().getTrace();
//console.log(trace);
assert.equal(trace, 'clearRect(0,0,578,200);save();lineJoin=round;transform(1,0,0,1,0,0);beginPath();moveTo(73,160);lineTo(340,23);lineCap=round;save();globalAlpha=0.3;shadowColor=black;shadowBlur=20;shadowOffsetX=10;shadowOffsetY=10;lineWidth=20;strokeStyle=blue;stroke();restore();lineCap=round;lineWidth=20;strokeStyle=blue;stroke();restore();');
var relaxedTrace = layer.getContext().getTrace(true);
//console.log(relaxedTrace);
assert.equal(relaxedTrace, 'clearRect();save();save();globalAlpha;shadowColor;shadowBlur;shadowOffsetX;shadowOffsetY;drawImage();restore();drawImage();restore();');
});
});