align support for Konva.TextPath

This commit is contained in:
Anton Lavrenov
2016-10-28 15:30:36 -06:00
parent d090e3662e
commit 0d11bff316
7 changed files with 154 additions and 9 deletions

View File

@@ -217,7 +217,7 @@ suite('Label', function() {
cloneAndCompareLayer(layer, 254);
});
it.only('tag should list text size changes', function() {
it('tag should list text size changes', function() {
var stage = addStage();
var layer = new Konva.Layer();
stage.add(layer);

View File

@@ -240,4 +240,28 @@ suite('TextPath', function() {
cloneAndCompareLayer(layer,50);
showHit(layer);
});
test('Text path with align', function() {
var stage = addStage();
var layer = new Konva.Layer();
var c = "M10,10 C0,0 10,150 100,100 S300,150 400,50";
var textpath = new Konva.TextPath({
stroke: 'black',
strokeWidth: 1,
fill: 'orange',
fontSize: 10,
fontFamily: 'Arial',
letterSpacing: 5,
text: 'All the world\'s a stage.',
align: 'center',
data: c
});
// TODO: add test case
layer.add(textpath);
stage.add(layer);
});
});