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:
Jürg Lehni 2013-06-12 19:30:23 -07:00
parent 463a00bd1e
commit fe10c99d1b
5 changed files with 18 additions and 4 deletions

View file

@ -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);
});