Login  Register

Re: Rectangle center rounding

Posted by Jan Blizničenko on Jul 23, 2015; 1:32pm
URL: https://forum.world.st/Rectangle-center-rounding-tp4837980p4838853.html

As far as I looked, only two rounding methods are center and aboveCenter (which has no senders in my image by the way and I do not even see purpose of it)... all other (like leftCenter) are getting value from mentioned self center.

So, the easiest way seems to subclass Rectangle and make something like Precise/Float/NotRounded/I'mNotVeryGoodAtNaming Rectangle
which will have just these two methods different, so there will be also this PreciseRectangle which is not rounding down, but original one stays unchanged.

However, the rounding seems to me like an extension/addition/subtype of general rectangle and I think that it should not be default behavior of something called just Rectangle, it should be more like Rectangle (not rounded) with subclass IntegerRectangle or something like that. I know, there are many senders right now which are dependent on the rounding, but I just think it should not be like that, or should it?

Jan

abergel wrote
Maybe we can introduce a new rectangle class.