2015-04-29 18:50 GMT+02:00 Tommaso Dal Sasso <tommaso.dalsasso@gmail.com>:


On 29/04/15 15:18, Sean P. DeNigris wrote:
> Natalia Tymchuk wrote
>> Should it really be like that?
>
> The problem is that you can't have half-a-pixel if a dimension is odd
>

For these situations, I would use the method #floor or #rounded of the
class Point, or create the method #roundedCenter, as Natalia suggested.

Currently, the name of the class and the method communicate the wrong
behavior.

Tommaso


Rectangle was and still is a primitive type known to low level graphics operations.
It's just that it pre-empts a word that is more generic than the implementation ;)

You can't even rotate a rectangle...
It's just a clipping or viewport rectangle having same orientation as a rectangular target canvas (image, bitmap, screen or other device).

Depending on what you are after, it's maybe not the right abstraction...

That does not mean that Rectangle can't be changed.
That means that it must be carefully changed as long as it is used for the low level stuff...

...or it must be split. Maybe it's where namespaces might help.

Nicolas

>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Rectangle-Center-tp4822883p4822891.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>