about containsPoint:

stéphane ducasse ducasse at iam.unibe.ch
Sat Nov 5 17:37:14 UTC 2005


testContainsPoint
     "self run: #testContainsPoint"

     self assert: ((0 at 0 extent: 300 at 200) containsPoint: 100 at 100).
     self deny: ((0 at 0 extent: 300 at 200) containsPoint: 0 at 299).
     self assert: ((0 at 0 extent: 300 at 200) containsPoint: 0 at 199).


     "strange behavior a rectangle includes a point that is equals to
     its origin but not its corner"
     self deny: ((0 at 0 extent: 300 at 200) containsPoint: 0 at 200).
     self assert: ((0 at 0 extent: 300 at 200) containsPoint: 0 at 0).
     self deny: ((0 at 0 extent: 300 at 200) containsPoint: 300 at 200).

may be this is to make sure that a point cannot belongs to two  
rectangles that would be just
overlapping of one pixel?

Stef



More information about the Squeak-dev mailing list