mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
implement letter spacing for Text Shape
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user