mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
refactored setLineDash a bit, added comments, and added a context trace assertion that tests line dash
This commit is contained in:
@@ -21,14 +21,7 @@ suite('Layer', function() {
|
||||
var style = layer.getCanvas()._canvas.style;
|
||||
|
||||
assert.equal(style.position, 'absolute', 'canvas position style should be absolute');
|
||||
|
||||
if (Kinetic.UA.browser === 'mozilla') {
|
||||
assert.equal(style.border, '0px none', 'canvas border style should be 0px');
|
||||
}
|
||||
else {
|
||||
assert.equal(style.border, '0px', 'canvas border style should be 0px');
|
||||
}
|
||||
|
||||
assert.equal(style.border.indexOf('0px'), 0, 'canvas border style should be 0px');
|
||||
assert.equal(style.margin, '0px', 'canvas margin style should be 0px');
|
||||
assert.equal(style.padding, '0px', 'canvas padding style should be 0px');
|
||||
assert.equal(style.backgroundColor, 'transparent', 'canvas backgroundColor style should be transparent');
|
||||
|
@@ -407,6 +407,10 @@ suite('Shape-test', function() {
|
||||
assert.equal(circle.getShadowEnabled(), true, 'shadowEnabled should be true');
|
||||
assert.equal(circle.getDashArrayEnabled(), true, 'dashArrayEnabled should be true');
|
||||
|
||||
var trace = layer.getContext().getTrace();
|
||||
//console.log(trace);
|
||||
assert.equal(trace, 'clearRect(0,0,578,200);save();transform(1,0,0,1,289,100);beginPath();arc(0,0,70,0,6.283,false);closePath();save();shadowColor=black;shadowBlur=10;shadowOffsetX=10;shadowOffsetY=10;fillStyle=green;fill();restore();fillStyle=green;fill();setLineDash([10,10]);lineWidth=4;strokeStyle=black;stroke();restore()');
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user