Rectangle differences between Pharo 3 & 4
I notice a difference between Pharo 3 & 4... Rectangle left: 4 right: 3 top: 2 bottom: 1. Build 30856 --> (4@2) corner: (3@1) Build 40309 --> (3@1) corner: (4@2) Rectangle origin: (4@1) corner: (3@2) Build 30856 --> (4@1) corner: (3@2) Build 40309 --> (3@1) corner: (4@2) I remember some report of Stef and Igor fixing some Rectangle stuff, but I wasn't paying attention in detail. Is this related? What is the intent? I noticed this reviewing the some tests added by mschepens https://pharo.fogbugz.com/default.asp?14221 It seems now there is an assumption that rectangles always go from top-left to bottom-right. I wonder what would be the effect (in a hypothetical application) if I am dragging a rectangular "rubber band" (as is commonly done for selection in graphics programs) and I move the secondary/corner point of a rectangle up and left of the first/origin point? Would it be correct to say that Points and Rectangles are immutable, and so maybe its not a problem, such that a "rubber band" selection would be creating new rectangles each mouse move? btw, Rectangle left: 1 right: 2 top: 3 bottom: 4. Build 30856 --> (1@3) corner: (2@4) Build 40309 --> (1@3) corner: (2@4) cheers -ben
On 17/10/14 03:55, Ben Coman wrote:
I notice a difference between Pharo 3 & 4...
Rectangle left: 4 right: 3 top: 2 bottom: 1. Build 30856 --> (4@2) corner: (3@1) Build 40309 --> (3@1) corner: (4@2)
Rectangle origin: (4@1) corner: (3@2) Build 30856 --> (4@1) corner: (3@2) Build 40309 --> (3@1) corner: (4@2)
I remember some report of Stef and Igor fixing some Rectangle stuff, but I wasn't paying attention in detail. Is this related? What is the intent?
The intent is that a rectangle is not a pair of point (especially for damage rectangle). Now a rectangle cannot have negative extent
I noticed this reviewing the some tests added by mschepens https://pharo.fogbugz.com/default.asp?14221
It seems now there is an assumption that rectangles always go from top-left to bottom-right. I wonder what would be the effect (in a hypothetical application) if I am dragging a rectangular "rubber band" (as is commonly done for selection in graphics programs) and I move the secondary/corner point of a rectangle up and left of the first/origin point?
Would it be correct to say that Points and Rectangles are immutable, and so maybe its not a problem, such that a "rubber band" selection would be creating new rectangles each mouse move?
I do not know but why not. And you can use "point:point:" to create a rectangle you are not forced to use corner:
btw, Rectangle left: 1 right: 2 top: 3 bottom: 4. Build 30856 --> (1@3) corner: (2@4) Build 40309 --> (1@3) corner: (2@4)
cheers -ben
participants (2)
-
Ben Coman -
stepharo