implement letter spacing for Text Shape

This commit is contained in:
Anton Lavrenov
2016-09-20 16:31:30 -04:00
parent fe92be3ab4
commit 834c1362c6
5 changed files with 78 additions and 10 deletions

View File

@@ -82,6 +82,24 @@ suite('Text', function(){
assert.equal(text.getClassName(),'Text', 'getClassName should be Text');
});
// ======================================================
test('add text with letter spacing', function() {
var stage = addStage();
var layer = new Konva.Layer();
stage.add(layer);
var text = new Konva.Text({
text: 'hello'
});
layer.add(text);
layer.draw();
var oldWidth = text.width();
text.letterSpacing(10);
assert.equal(text.width(), oldWidth + 40);
layer.draw();
});
// ======================================================
test('text getters and setters', function() {
var stage = addStage();