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

@ -12,6 +12,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- changing a size of `Konva.Stage` will update it in async way (via `batchDraw`).
- `shadowOffset` respect pixel ratio now
### Fixed
- Fixed bug when `Konva.Tag` width was not changing its width dynamically
## [1.2.2][2016-09-15]
### Fixed

View File

@ -15870,7 +15870,7 @@
(function() {
'use strict';
// constants
var ATTR_CHANGE_LIST = ['fontFamily', 'fontSize', 'fontStyle', 'padding', 'lineHeight', 'text'],
var ATTR_CHANGE_LIST = ['fontFamily', 'fontSize', 'fontStyle', 'padding', 'lineHeight', 'text', 'width'],
CHANGE_KONVA = 'Change.konva',
NONE = 'none',
UP = 'up',

2
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
(function() {
'use strict';
// constants
var ATTR_CHANGE_LIST = ['fontFamily', 'fontSize', 'fontStyle', 'padding', 'lineHeight', 'text'],
var ATTR_CHANGE_LIST = ['fontFamily', 'fontSize', 'fontStyle', 'padding', 'lineHeight', 'text', 'width'],
CHANGE_KONVA = 'Change.konva',
NONE = 'none',
UP = 'up',

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());
});
});