mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 17:21:36 +08:00
fixed bug with getTextSize() which was throwing a JS error if used before adding text to the stage
This commit is contained in:
@@ -1936,6 +1936,9 @@ Test.prototype.tests = {
|
||||
verticalAlign: 'middle'
|
||||
});
|
||||
|
||||
// test text width before adding it to stage
|
||||
test(text.getTextWidth() > 0, 'text width should have a value');
|
||||
|
||||
layer.add(text);
|
||||
stage.add(layer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user