Added support for text strikethrough

This commit is contained in:
kudlajz
2017-02-07 15:32:14 +01:00
parent 21c3430664
commit 4b48544059
4 changed files with 88 additions and 16 deletions

View File

@@ -463,7 +463,7 @@ suite('Text', function(){
// ======================================================
// skiping this test for now. It fails on travis. WHYYY??!?!?!
// TODO: restore it
test.skip('text multi line with textDecoration and spacing', function() {
test.skip('text multi line with underline and spacing', function() {
var stage = addStage();
var layer = new Konva.Layer();
@@ -488,6 +488,46 @@ suite('Text', function(){
});
test('text multi line with strike', function() {
var stage = addStage();
var layer = new Konva.Layer();
var text = new Konva.Text({
x: 10,
y: 10,
text: 'hello\nworld',
fontSize: 80,
fill: 'red',
textDecoration: 'line-through'
});
layer.add(text);
stage.add(layer);
// TODO
// assert.equal(layer.getContext().getTrace(), trace);
});
test('text multi line with underline and strike', function() {
var stage = addStage();
var layer = new Konva.Layer();
var text = new Konva.Text({
x: 10,
y: 10,
text: 'hello\nworld',
fontSize: 80,
fill: 'red',
textDecoration: 'underline line-through'
});
layer.add(text);
stage.add(layer);
// TODO
// assert.equal(layer.getContext().getTrace(), trace);
});
// ======================================================
test('change font size should update text data', function() {
var stage = addStage();