mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
fix bug with getAllIntersections and Text shape. close #224
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user