[squeak-dev] Proposal: Morphs in Text

karl ramberg karlramberg at gmail.com
Sat Jun 29 17:59:46 UTC 2019

I'm a little late here.
TextMorph does not really need TextAnchor I think.
You can just drop morphs on the text and select avoid occlusions in the
What are the use of text anchors instead just dropped in morphs ?
I filed in TextAnchorPlacement change set and it interferes somewhat with
the avoid occlusions functions.


On Fri, Jun 28, 2019 at 4:42 PM <patrick.rein at hpi.uni-potsdam.de> wrote:

> Hi everyone,
> please find attached a new version of the change including an improved
> protocol for setting the alignment added by Chris (basically as discussed
> below). :)
> Bests
> Patrick
> >Hi Chris,
> >
> >thanks for the recommendations!
> >
> >>The only thing that gave me pause was that API for #verticalAlignment:.
> Initially, I just saw the selector and thought about it the same as the API
> for regular horizontal text alignment (e.g., #left, #center, #right,
> justified), and so tried:
> >>    self verticalAlignment: #bottom
> >>but this informed me that this single-argument selector is actually
> looking for two arguments.  That's some great flexibility that I didn't
> even consider, but I wonder whether this detracts from the usability of the
> common cases:
> >>   #bottom, expected to do what #(#bottom #bottom) does,   #center, to
> do what, uh, #(#middle #middle) does, and   #top, would do what, #top #top
> does.
> >>#verticalAlignment: handle the above, while #verticalAlignmentMorph: and
> #verticalAlignmentLine: could be used for advanced customizations.  Even
> once I figured out it wanted a two-element Array for input, I had to go
> back look at the method to remind myself which is first and which is
> second.  Separate attributes would be more readable.
> >
> >That is a good point. I myself had some difficulties remembering which
> way they have to go... I have added a convenience case which now allows for
> just sending a symbol and the method takes care of converting it to the
> array internally (so #top results in #(top top)).
> >
> >>Lastly, #middle vs. #center.  #center is what we have _everywhere_ to
> refer to geometric centers, all over the image, including even for
> horizontal text-alignment.  The only #middle in the whole image relates to
> a Collection element access.  Could we use #center?
> >
> >Yes, that makes sense :) I renamed #middle to #center.
> >
> >The new changeset includes these changes.
> >
> >Bests
> >Patrick
> >
> >
> >["TextAnchorPlacement.cs"]
> >
> >
> >[TextAnchorPlacement.cs]
> ["TextAnchorPlacement.cs"]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190629/498cb1eb/attachment.html>

More information about the Squeak-dev mailing list