Note that VW has Rectangle class>>vertex:vertex:, and we probably should add such message...Now Igor and Stephane had another view more geometric and un-oriented, and wanted to change conventions/handling of empty rectangles in Pharo.And this was globally well maintained except a few breakages introduced in Squeak along the years (but I hope I corrected most of the slips since then).There is an assumption that a rectangle with negative width (right->left) or height (bottom->top) should be treated as empty.And you have creation messages Rectangle class>>origin:corner:From the st80 ages, rectangle have allways been oriented.You have an origin and a corner inst var, not 2 corners or vertices.
The conventions are that of latin scribes, the orientation of rectangle should be (left->right , top->down)
I don't know how far they went, or even if it is feasible at all... IMO, it's a recipe for maximizing breakage/gain ratio.
2014-03-21 15:15 GMT+01:00 Noury Bouraqadi <bouraqadi@gmail.com>:
Inverting the origin and the corner of a rectangle changes the result of intersection.
I guess it's a bug, though I imagine that changing the code of Rectangle is likely to have deep/undesired consequences..
(0@0 corner: 100@100) intersects: (-50@ -50 corner: 80@80) ==> true
(100@100 corner: 0@0) intersects: (-50@ -50 corner: 80@80) ==> false �!!!!
Noury