Newbie question: ConstantShapeMorph?
bspight at pacbell.net
Thu Jan 2 19:41:53 UTC 2003
Happy New Year!
> >> extent: aPoint
> >> x _ aPoint x.
> >> y _ aPoint y.
> >> (y * aspectRatio) > x ifTrue: [
> >> x _ y * aspectRatio
> >> ] ifFalse: [
> >> y _ x / aspectRatio
> >> ].
> >Doing it this way makes for the greater extent, which is faster when
> I could easily have picked smaller rather than greater. Since it wasn't specified,
> I flipped a coin.
I used this approach to resizing a Constant Shape Rectangle Morph, and
then put one in a window, with unexpected results. ;-) First, the Morph
went transparent, and this seems to be true for Morphs in general when
you open or put them in windows. Second, after I recolorized the Morph,
it became apparent that resizing the window could easily put the Morph
outside the window. It seems like the window tries to make the Morph fit
the window exactly, which will rarely work with a Constant Shape Morph.
Also, once the Morph went outside the window, it was difficult to resize
the window to encompass the morph, although I think that in theory it
should be possible. Anyway, I was never able to do so.
Question: Why do morphs go transparent in windows?
In using the Halo handle to resize a Constant Shape Morph, I found that
the Morph tended to go outside the implicit boundaries implied by the
handle. I figured that it would be better ergonomics to keep the Morph
inside the implicit boundaries, and therefore switched to using the
lesser extent for resizing. That kept the Morph in bounds, and also
More information about the Squeak-dev