some bugs fixes

This commit is contained in:
Anton Lavrenov
2018-06-05 21:28:34 +07:00
parent 8c475c0637
commit be5362dcfa
8 changed files with 1550 additions and 1404 deletions

View File

@@ -286,6 +286,29 @@ suite('Line', function() {
});
});
// TODO: FIX IT!!!
test.skip('getClientRect rotated', function() {
var stage = addStage();
var layer = new Konva.Layer();
var line = new Konva.Line({
x: 20,
y: 20,
rotation: 45,
points: [0, 0, 50, 50],
closed: true,
stroke: '#0f0'
});
layer.add(line);
stage.add(layer);
var rect = line.getClientRect();
assert.equal(rect.x, 19, 'check x');
assert.equal(rect.y, 19, 'check y');
// assert.equal(rect.width, 2, 'check width');
assert.equal(rect.height, 52, 'check height');
});
test('line caching', function() {
var stage = addStage();
var layer = new Konva.Layer();

View File

@@ -74,6 +74,28 @@ suite('TextPath', function() {
stage.add(layer);
});
// ======================================================
test('Check getter and setter', function() {
var stage = addStage();
var layer = new Konva.Layer();
var c = 'M 50 50 l 250 0';
var path = new Konva.TextPath({
text: 'some text',
stroke: 'red',
strokeWidth: 1
});
layer.add(path);
stage.add(layer);
assert.equal(path.getData(), undefined);
path.data(c);
assert.equal(path.getData(), c);
layer.draw();
});
// ======================================================
test('Render Text Along Vertical Line', function() {
var stage = addStage();