Mantis - Squeak
Viewing Issue Advanced Details
6494 Graphics minor always 05-19-07 20:29 05-19-07 21:34
wiz  
andreas  
normal  
assigned  
open  
none    
none  
0006494: Rectangle>>intersect: answers an improper Rectangle when receiver and argument don't overlap.
for this one in a workspace evaluate:

rect1 :=
10 asPoint extent: 10 asPoint.

rect2 :=
30 asPoint extent: 10 asPoint.

rect1 intersect: rect2 .

"answers: 30@30 corner: 20@20"

This is troublesome because it means getting a proper answer requires knowing if the two rectangles intersect before calling the method.

This to me is counter intuitive.
I would call the method and expect some form of zero area rectangle to be returned when no intersection occurs.

There are 74 senders of #intersect: in a fresh 3dot9 (7067).

A quick glance shows that most of these call the method without calling #intersects: first to insure the result will be valid.

So I bet this causes bugs galore.

Yours in curiosity and service, --Jerome Peace

Notes
(0010731)
andreas   
05-19-07 20:38   
Although this sounds odd, this *is* a zero area rectangle. Ask for its area and it will answer zero.
(0010732)
wiz   
05-19-07 21:34   
Ha. You're right it is zero area.

I still bet it is causing bugs.

Cheers, -Jer