[Pharo-project] about fillRectangle: aRectangle fillStyle: aFillStyle

Igor Stasenko siguctua at gmail.com
Thu Feb 10 01:06:10 CET 2011

On 9 February 2011 14:38, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
> it seems duplicated in
> pluggableCanvas, canvas and balloonCanvas
> fillRectangle: aRectangle fillStyle: aFillStyle
>        "Fill the given rectangle. Double-dispatched via the fill style."
>        aFillStyle fillRectangle: aRectangle on: self
> do you confirm that?

it is a bit tricky. The #fillRectange:fillStyle: is a double-dispatch entry
actually one could use:

aFillStyle fillRectangle: aRectangle on: self

See a CompositeFillStyle how it works.

The idea was to replace all uses of #doSomething: x color: y
or #doSomething:border:colorA:colorB:

with #doSomething: x fillStyle: y...

Actually all painting operations could take only two objects: shape
and fill style.

So, in this respect, a color property of Morph should be a fill style,
since color can be described as 'solid fill with single color' fill
a most simplest possible one.

Best regards,
Igor Stasenko AKA sig.

More information about the Pharo-project mailing list