about fillRectangle: aRectangle fillStyle: aFillStyle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

about fillRectangle: aRectangle fillStyle: aFillStyle

Stéphane Ducasse
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?

Reply | Threaded
Open this post in threaded view
|

Re: about fillRectangle: aRectangle fillStyle: aFillStyle

Igor Stasenko
On 9 February 2011 14:38, Stéphane Ducasse <[hidden email]> 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
style,
a most simplest possible one.

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: about fillRectangle: aRectangle fillStyle: aFillStyle

Stéphane Ducasse
Igor I saw that this was a double dispatch but I imagine that this is not needed to duplicate the exact same code within the
same hierarchy.
Can you have a look?
I will prepare a cs or a slice with all my changes and it would be great to have somebody else having a look.

Stef

> 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
> style,
> a most simplest possible one.
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>


Reply | Threaded
Open this post in threaded view
|

Re: about fillRectangle: aRectangle fillStyle: aFillStyle

Fernando olivero-2
I volunteer for reviewing th cs also.

Fernando

On Thu, Feb 10, 2011 at 6:43 AM, Stéphane Ducasse
<[hidden email]> wrote:

> Igor I saw that this was a double dispatch but I imagine that this is not needed to duplicate the exact same code within the
> same hierarchy.
> Can you have a look?
> I will prepare a cs or a slice with all my changes and it would be great to have somebody else having a look.
>
> Stef
>
>> 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
>> style,
>> a most simplest possible one.
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: about fillRectangle: aRectangle fillStyle: aFillStyle

Stéphane Ducasse
thanks a lot!!!

Stef

On Feb 10, 2011, at 11:10 AM, Fernando Olivero wrote:

> I volunteer for reviewing th cs also.
>
> Fernando
>
> On Thu, Feb 10, 2011 at 6:43 AM, Stéphane Ducasse
> <[hidden email]> wrote:
>> Igor I saw that this was a double dispatch but I imagine that this is not needed to duplicate the exact same code within the
>> same hierarchy.
>> Can you have a look?
>> I will prepare a cs or a slice with all my changes and it would be great to have somebody else having a look.
>>
>> Stef
>>
>>> 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
>>> style,
>>> a most simplest possible one.
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko AKA sig.
>>>
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: about fillRectangle: aRectangle fillStyle: aFillStyle

Stéphane Ducasse
In reply to this post by Fernando olivero-2
http://code.google.com/p/pharo/issues/detail?id=3691
I uploaded my fix.
Note that I introduced a log class and should probably remove it but I will do that during the integration.

Stef

> I volunteer for reviewing th cs also.
>
> Fernando
>
> On Thu, Feb 10, 2011 at 6:43 AM, Stéphane Ducasse
> <[hidden email]> wrote:
>> Igor I saw that this was a double dispatch but I imagine that this is not needed to duplicate the exact same code within the
>> same hierarchy.
>> Can you have a look?
>> I will prepare a cs or a slice with all my changes and it would be great to have somebody else having a look.
>>
>> Stef
>>
>>> 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
>>> style,
>>> a most simplest possible one.
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko AKA sig.
>>>
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: about fillRectangle: aRectangle fillStyle:aFillStyle

Gary Chambers-4
In reply to this post by Stéphane Ducasse
The reason was that Squeak had (differing) implementations in each class
before I introduced the double-dispatch.
Since Polymorph was a loadable package, they needed to be overridden.

In Pharo they can, of course, be removed to just leave the Canvas one.

Regards, Gary

----- Original Message -----
From: "Stéphane Ducasse" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, February 10, 2011 6:43 AM
Subject: Re: [Pharo-project] about fillRectangle: aRectangle
fillStyle:aFillStyle


Igor I saw that this was a double dispatch but I imagine that this is not
needed to duplicate the exact same code within the
same hierarchy.
Can you have a look?
I will prepare a cs or a slice with all my changes and it would be great to
have somebody else having a look.

Stef

> 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
> style,
> a most simplest possible one.
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>