about containsPoint:
stéphane ducasse
ducasse at iam.unibe.ch
Sat Nov 5 19:09:55 UTC 2005
Hi bert
Thanks for the explanation.
I never got any lectures in graphics :).
Ok so I will update the comments of the method then.
Stef
On 5 nov. 05, at 19:49, Bert Freudenberg wrote:
>
> Am 05.11.2005 um 18:37 schrieb stéphane ducasse:
>
>
>> 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?
>>
>
> Yes. Rasterizing two adjacent rectangles (e.g., "rect1 right =
> rect2 left") should leave no gap and touch every pixel exactly
> once. This is a basic property of all graphics packages (google for
> "rasterization rules" if you want to learn more), but often comes
> as a surprise to graphics newbies, because geometry in school does
> not deal with rasterization.
>
> - Bert -
>
>
>
>
More information about the Squeak-dev
mailing list
|