changed isPointInShape() to intersects(). Currently the method accepts a point object, but I may extend this to also accept another shape object

This commit is contained in:
Eric Rowell
2012-04-27 20:54:49 -07:00
parent c02e7a0cee
commit 2879c0763f
5 changed files with 18 additions and 20 deletions

View File

@@ -1303,7 +1303,7 @@ Test.prototype.tests = {
star.setDetectionType('pixel');
test(star.getDetectionType() === 'pixel', 'detection type should be pixel');
},
'SHAPES - test isPointInPath()': function(containerId) {
'SHAPES - test intersects()': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,
width: 578,
@@ -1323,30 +1323,30 @@ Test.prototype.tests = {
layer.add(rect);
stage.add(layer);
test(rect.isPointInShape({
test(rect.intersects({
x: 200,
y: 100
}) === true, 'problem with point in shape');
test(rect.isPointInShape({
test(rect.intersects({
x: 199,
y: 99
}) === false, 'problem with point in shape');
}) === false, 'intersects with point in shape');
test(rect.isPointInShape({
test(rect.intersects({
x: 250,
y: 125
}) === true, 'problem with point in shape');
}) === true, 'intersects with point in shape');
test(rect.isPointInShape({
test(rect.intersects({
x: 300,
y: 150
}) === true, 'problem with point in shape');
}) === true, 'intersects with point in shape');
test(rect.isPointInShape({
test(rect.intersects({
x: 301,
y: 151
}) === false, 'problem with point in shape');
}) === false, 'intersects with point in shape');
},
'Text - add text': function(containerId) {
var stage = new Kinetic.Stage({