mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Fixed bug when Konva.Tag
width was not changing its width dynamically. close #173
This commit is contained in:
parent
d3e0a98e75
commit
d090e3662e
@ -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
|
||||
|
2
konva.js
2
konva.js
@ -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
2
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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',
|
||||
|
@ -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());
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user