fix bug with getAllIntersections and Text shape. close #224

This commit is contained in:
Anton Lavrenov
2017-04-21 10:40:41 -05:00
parent 8d1fd1218f
commit 865577b7e6
5 changed files with 32 additions and 5 deletions

View File

@@ -467,6 +467,30 @@ suite('Stage', function() {
);
});
// ======================================================
test('test getAllIntersections for text', function() {
var stage = addStage();
var layer = new Konva.Layer();
var text = new Konva.Text({
x: 0,
y: 0,
text: 'Hello world',
fontSize: 50,
name: 'intersectText'
});
layer.add(text);
stage.add(layer);
// test individual shapes
assert.equal(
stage.getAllIntersections({ x: 10, y: 10 }).length,
1,
'17) getAllIntersections should return one shape'
);
});
// ======================================================
test('scale stage after add layer', function() {
var stage = addStage();