Fwd: Canvas >>draw: anObject

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

Fwd: Canvas >>draw: anObject

Stéphane Ducasse


Begin forwarded message:

> From: "[hidden email]" <[hidden email]>
> Date: February 8, 2011 2:25:33 AM GMT+01:00
> To: [hidden email], [hidden email]
> Subject: RE: Canvas >>draw: anObject
> Reply-To: [hidden email]
>
> (Please forward to Pharo, it seems I can't send to it from webmail)
>
> The difference is not really important. If you have a Morph that draws
> outside
> its bounds (no morph should ever do that) the version in SM (I guess it is
> the
> original Squeak code), will clip. The Pharo version won't. That means that
> such
> a morph would leave a trail if moved around.
>
> For example, I just added:
> aCanvas fillRectangle: (bounds translateBy: 10)  fillStyle: Color red.
> at the start of EllipseMorph>>drawOn: , and modified #draw: to be like in
> Pharo.
> Then you open an ellipse, and when you move it around it leaves red garbage.
>
> If morphs work properly, then it makes no difference. Maybe a very slight
> performance difference, but not sure.
>
> HTH.
>
> Cheers,
> Juan Vuletich
>
> Original Message:
> -----------------
> From: Stéphane Ducasse [hidden email]
> Date: Mon, 7 Feb 2011 22:41:08 +0100
> To: [hidden email], [hidden email]
> Subject: Canvas >>draw: anObject
>
>
> Canvas>>draw: anObject
> ^anObject drawOn: self
>
>
> Now in SM we got
>
> SMxCanvas>>draw: anObject
> ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>
> and I'm wondering what is the exact difference.
> Any idea?
>
> Stef
>
>
> --------------------------------------------------------------------
> mail2web.com – Enhanced email for the mobile individual based on Microsoft®
> Exchange - http://link.mail2web.com/Personal/EnhancedEmail
>
>