canvas withFillStyle: aStyle do: aBlock.
canvas fillRect: aRect.
> On 21/03/2008, Gary Chambers <
[hidden email]> wrote:
>
> > P.S. Just rectangular fills as a proof of concept for the moment.
> >
> >
> > > -----Original Message-----
> > > From:
[hidden email]
> >
> > > [mailto:
[hidden email]]On Behalf Of Gary Chambers
> > > Sent: 21 March 2008 5:59 PM
> > > To: Squeak's User Interface
> >
> > > Subject: RE: [UI] A small change... for a start
> > >
> > >
> > > Pinesoft-Widgets-gvc.302 on SqueakMap. Nebraska not included in
> > > changes (may do a separate package for that if there is interest).
> > >
> > > Added CompositeFillStyle. Canvas double-dispatches to the
> > > fillstyle/color/infiniteForm.
> > > Should allow more complex fills through subclassing(like pieced
> > > together from forms for a button, top-left image, top image etc.).
> > >
> > > Have fun!
> > >
>
>
> It looks double-dispatch needed from a BaloonEngine, not from Canvas.
> A fillStyle needs method #registerFillWith: engine.
>
> So, it will dispatch back to BalloonEngine with messages like:
>
> ^ engine registerSolidFill: self. "For single color fill"
>
> ^ engine registerGradientFill: self "For gradient fill"
>
> ^ engine registerBitmapFill: self "For bitmap fill"
>
> And BaloonEngine>>registerFill: aFill should look like:
> ^ aFill registerFillWith: self.
>
> Otherwise we need to extend canvas protocol with methods:
>
> #fillRectangle:color:
> #fillRectangle:gradient:
> #fillRectangle:bitmap:
>
> I don't like that there is need in additional checking for fill type
> later, after canvas receives
> #fillRectangle:basicFillStyle:
> i think it would be better to be precise after dispatch, what basic
> fill type should be used.
>
> > > Gary
>
> > >
> --
> Best regards,
> Igor Stasenko AKA sig.
>
Igor Stasenko AKA sig.