mirror of
https://github.com/konvajs/konva.git
synced 2025-10-14 20:04:52 +08:00
ring param sync :neckbeard: fix #987
This commit is contained in:
@@ -21,4 +21,33 @@ suite('Ring', function() {
|
||||
var trace = layer.getContext().getTrace();
|
||||
assert.equal(trace, 'clearRect(0,0,578,200);save();transform(1,0,0,1,289,100);beginPath();arc(0,0,50,0,6.283,false);moveTo(90,0);arc(0,0,90,6.283,0,true);closePath();fillStyle=green;fill();lineWidth=4;strokeStyle=black;stroke();restore();');
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
// test for https://github.com/ericdrowell/KineticJS/issues/987
|
||||
test('ring attrs sync', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Kinetic.Layer();
|
||||
var ring = new Kinetic.Ring({
|
||||
name: 'ring',
|
||||
x: 30,
|
||||
y: 50,
|
||||
width: 50,
|
||||
height: 50,
|
||||
innerRadius: 15,
|
||||
outerRadius: 30,
|
||||
fill: 'green',
|
||||
stroke: 'black',
|
||||
strokeWidth: 4,
|
||||
draggable: true
|
||||
});
|
||||
layer.add(ring);
|
||||
stage.add(layer);
|
||||
|
||||
|
||||
var cring = ring.clone();
|
||||
assert.equal(cring.outerRadius(), ring.outerRadius());
|
||||
|
||||
assert.equal(ring.attrs.width, ring.outerRadius() * 2);
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user