[squeak-dev] Speaking of all those hacks in HandMorph...

Bert Freudenberg bert at freudenbergs.de
Tue Mar 3 23:47:23 UTC 2015


On 03.03.2015, at 12:18, Marcel Taeumel <marcel.taeumel at student.hpi.uni-potsdam.de> wrote:
> 
> Hi, there!
> 
> I am just looking into all those scary hacks in HandMorph regarding drawing
> routings...
> 
> Why? I stumbled upon GrafPort (BitBlt) #image:at:... methods and noticed
> that thei ignore Form >> #offset, which is important for AnimatedImageMorph
> (and animated GIFs).
> 
> I fixed that.

I'm not sure that is the right way to fix it. Rather, AnimatedImageMorph should not ignore the offset.

> Then, dragging things with the hand got messed up.
> 
> Let me summarize it one question:
> 
> Why does HandMorph not behave like other morphs considering, #fullBounds,
> #changed, #position:, #fullDrawOn:, #hasDropShadow, #drawDropShadowOn:,
> #drawSubmorphsOn:... ? Is it or was it a performance thing?

Likely performance, yes, and also the hands are not considered part of the world (they are not submorphs of the world).

> The goal is to avoid code like that:
> 
> aCanvas paintImage: aForm at: aForm offset.

Why?

> Because only BitBlt should read #offset.

BitBlt ignores the offset. The offset is pretty much only used for cursors.

- Bert -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4115 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20150303/8ca20095/smime.bin


More information about the Squeak-dev mailing list