mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Implement standard behavior of #_hitTest() for items without children, based on #_contains().
This should cover the minimum of what's needed for PointText.
This commit is contained in:
parent
463a00bd1e
commit
fe10c99d1b
5 changed files with 18 additions and 4 deletions
|
@ -14,9 +14,15 @@ module('TextItem');
|
|||
|
||||
test('PointText', function() {
|
||||
var text = new PointText({
|
||||
font: 'Arial',
|
||||
fontSize: 14,
|
||||
point: [100, 100],
|
||||
content: 'Hello World!'
|
||||
});
|
||||
equals(text.point, { x: 100, y: 100 });
|
||||
equals(text.fillColor, { red: 0, green: 0, blue: 0 }, 'text.fillColor should be black by default');
|
||||
equals(text.point, { x: 100, y: 100 });
|
||||
equals(text.bounds.point, { x: 100, y: 87.4 });
|
||||
equals(function() {
|
||||
return text.hitTest(text.bounds.center) != null;
|
||||
}, true);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue