[squeak-dev] Rendering a text along an arc

karl ramberg karlramberg at gmail.com
Mon Dec 31 14:38:29 UTC 2018


This part of code in TextOnCurve>>composeLinesFrom: startingIndex
withLines: startingLines atY: startingY
...
lines last last < text size
        ifTrue:
            [
            [lines size > 1
                and: [(text at: (i := lines last last) + 1) ~= Character
space]]
                    whileTrue:
                        [i = lines last first
                            ifTrue:
                                [lines removeLast.
                                textSegments removeLast]
                            ifFalse: [lines last stop: i - 1]]].

If the text overflow the end of the curve only the first segment of the
text will be shown.
I think this will make sense when the text overflow into a predecessor or
successor. See TextMorph.
But there are no hooks back to the text morph so there is no way to know if
there is a predecessor or successor.
So if the curve is to short it will be kind of buggy...
Cheers,
Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20181231/ca86c6e3/attachment.html>


More information about the Squeak-dev mailing list