fix: handle Arc clockwise on getSelfRect

This commit is contained in:
i18u
2021-11-26 10:15:35 +08:00
parent a120ae93b3
commit bed6f8bb7a
2 changed files with 36 additions and 1 deletions

View File

@@ -96,6 +96,34 @@ describe('Arc', function () {
});
});
it('getSelfRect on clockwise', function () {
var stage = addStage();
var layer = new Konva.Layer();
var arc = new Konva.Arc({
x: 100,
y: 100,
innerRadius: 50,
outerRadius: 80,
angle: 90,
fill: 'green',
stroke: 'black',
strokeWidth: 4,
name: 'myArc',
draggable: true,
clockwise: true,
});
layer.add(arc);
stage.add(layer);
assert.deepEqual(arc.getSelfRect(), {
x: -80,
y: -80,
width: 160,
height: 160,
});
});
it('cache', function () {
var stage = addStage();
var layer = new Konva.Layer();