Fixed bug when Konva.Tag width was not changing its width dynamically. close #173

This commit is contained in:
Anton Lavrenov
2016-10-25 09:42:32 -06:00
parent d3e0a98e75
commit d090e3662e
5 changed files with 32 additions and 3 deletions

View File

@@ -217,4 +217,30 @@ suite('Label', function() {
cloneAndCompareLayer(layer, 254);
});
it.only('tag should list text size changes', function() {
var stage = addStage();
var layer = new Konva.Layer();
stage.add(layer);
var label = new Konva.Label();
var tag = new Konva.Tag({
stroke: 'black'
});
label.add(tag);
var text = new Konva.Text({
text: 'hello hello hello hello hello hello hello hello'
});
label.add(text);
layer.add(label);
layer.draw();
text.width(200);
layer.draw();
assert.equal(tag.width(), text.width());
});
});