fix "same value" detection in setAttr. fix #378

This commit is contained in:
Anton Lavrenov
2018-04-11 09:01:10 +07:00
parent 76d3282fcf
commit f8bd25cbfe
6 changed files with 52 additions and 5 deletions

View File

@@ -309,4 +309,34 @@ suite('Line', function() {
layer2.hide();
compareLayers(layer, layer2);
});
test('updating points with old mutable array should trigger recalculations', function() {
var stage = addStage();
var layer = new Konva.Layer();
var points = [-25, 50, 250, -30, 150, 50];
var blob = new Konva.Line({
x: 50,
y: 50,
points: points,
stroke: 'blue',
strokeWidth: 10,
draggable: true,
closed: true,
tension: 1
});
var tensionPoints = blob.getTensionPoints();
points.push(250, 100);
blob.setPoints(points);
layer.add(blob);
stage.add(layer);
assert.equal(
tensionPoints === blob.getTensionPoints(),
false,
'calculated points should change'
);
});
});