[squeak-dev] Squeak clock face

Bob Arning arning315 at comcast.net
Tue Dec 19 17:30:13 UTC 2017


The setting and later reporting of position are not different and this 
is a cause of occasional errors. If you have

MorphA>>initialize

     self addMorph: (MorphB new position: 1 at 1)


then B will be positioned one pixel from the top left of A. If, however, 
you do

     self addMorph: (MorphB new position: 1 at 1)

sometime later after A has been added to the World and possibly moved, 
then you may get something different, like B being one pixel from the 
Display top left, regardless of where A is currently. If that is the 
case, and, maybe, as a general precaution, then


     self addMorph: (MorphB new position: 1 at 1 + self position)

would be more robust.


On 12/19/17 11:41 AM, Louis LaBrunda wrote:
> It seems odd to me that when the position of a new TransformationMorph is set it is based on
> where it is to go in its parent morph but if you ask it its position later, it answers its
> position on the screen.  I say that this disconnection may have something to do with the
> rotation problem because I think the rotation code does some math based upon the position of
> the morph.  I expect the code thinks it is using a position based upon the parent and not the
> screen.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20171219/ee4e1696/attachment.html>


More information about the Squeak-dev mailing list