[Pharo-dev] InfiniteForm

pharo4Stef at free.fr pharo4Stef at free.fr
Thu Apr 17 15:39:08 EDT 2014


thanks igor I was thinking about that too but I thought that it could 
not be that simple :)

On 17/4/14 02:20, Igor Stasenko wrote:
>
>
>
> On 15 April 2014 23:15, pharo4Stef at free.fr <mailto:pharo4Stef at free.fr> 
> <pharo4Stef at free.fr <mailto:pharo4Stef at free.fr>> wrote:
>
>     There a plenty of isKindOf: InfiniteForm in the system and I was
>     trying to understand how we could get rid of them.
>     How other systems handle pattern based color filling shape?
>
> why bother?
>
> Just use The God's Hammer Dispatch (AKA Non-intuitive way of programming
> for those who don't think in objects ;) :
>
> fillRectangle: aRectangle basicFillStyle: aFillStyle
>     "Fill the given rectangle with the given, non-composite, fill style."
>
>     | pattern |
>
>     (aFillStyle isKindOf: InfiniteForm) ifTrue: [
>         ^self infiniteFillRectangle: aRectangle fillStyle: aFillStyle
>     ].
>
>
> =>
>
> fillRectangle: aRectangle basicFillStyle: aFillStyle
>     "Fill the given rectangle with the given, non-composite, fill style."
>     ^ aFillStyle fillRectangle: aRectangle onCanvas: self
>
>
> ..and then after refactoring it will look exactly how Athens doing it,
> because if you rename fill style with "paint" and rectangle with 
> "shape" you will see it :)
>
>
>     Stef
>
>
>
>
> -- 
> Best regards,
> Igor Stasenko.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20140417/7b32096b/attachment-0002.html>


More information about the Pharo-dev mailing list