I'm afraid it still doesn't work for me.

If I have a drawBlock like this:

drawBlock

^ [ :aCanvas | 
          | paint surface |
          surface := aCanvas surface.
          paint := surface
                           createLinearGradient: { 
                                           (0 -> Color blue).
                                           (1 -> Color black) }
                           start: 0 @ 0
                           stop: aCanvas surface extent.
          surface clear.
          aCanvas setPaint: paint.
          aCanvas drawShape: (0 @ 0 corner: aCanvas surface extent) ]

I get just a blank canvas.- nothing is drawn.

If I replace the aCanvas surface extent with a fixed size like this:

drawBlock

        ^ [ :aCanvas | 
          | paint surface |
          surface := aCanvas surface.

          paint := surface
                           createLinearGradient: { 
                                           (0 -> Color red).
                                           (1 -> Color green) }
                           start: 0 @ 0
                           stop: 300 @ 300.
          surface clear.
          aCanvas setPaint: paint.
          aCanvas drawShape: (0 @ 0 corner: 300 @ 300) ]

then it works.

Any ideas what i might be doing wrong?










--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply via email to