[squeak-dev] The Trunk: Morphic-mt.1962.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Tue Apr 12 05:37:42 UTC 2022


Hi Tim --

Sorry for being lazy. Yes, we should also rename that instVar but this has a rather low priority as I am struggling at various . Here are some considerations:

- Add+remove instVars will kill state which is problematic here for keeping the system running
- Rename instVars is possible via meta-programming in the preamble; affected accessors/methods should be changed, though

As I time boxed this refactoring, I decided to address the main concern, which was the public API.

Best,
Marcel
Am 12.04.2022 07:25:11 schrieb Tim Johnson <digit at sonic.net>:
Am I understanding this right — that these changes rename all methods to be #averageLineLength, while leaving the underlying instance variable to still be named #numCharactersPerLine?

> On Apr 7, 2022, at 12:59 AM, commits at source.squeak.org wrote:
>
> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-mt.1962.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-mt.1962
> Author: mt
> Time: 7 April 2022, 9:59:46.204476 am
> UUID: c4d79229-4b41-7242-9398-52f0b8dd10e1
> Ancestors: Morphic-ct.1961
>
> Renames #numCharactersPerLine to #averageLineLength. Step 1 of 2.
>
> =============== Diff against Morphic-ct.1961 ===============
>
> Item was added:
> + ----- Method: PluggableTextMorph>>averageLineLength (in category 'accessing') -----
> + averageLineLength
> +
> + ^ textMorph averageLineLength!
>
> Item was added:
> + ----- Method: PluggableTextMorph>>averageLineLength: (in category 'accessing') -----
> + averageLineLength: numCharsOrNil
> +
> + textMorph averageLineLength: numCharsOrNil.!
>
> Item was added:
> + ----- Method: TextMorph>>averageLineLength (in category 'layout') -----
> + averageLineLength
> + "Answers the average length per line in characters. When the entire content is composed in the receiver's #textStyle's default font, it will be an exact match only for monospaced fonts. For variable width fonts it will be an average depending on the (natural) language used, number of lines, and each glyph's advance width. Optimized for English text. Can vary greatly when combining different font faces or sizes. See commentary in #withNoLineLongerThan: and TextStyle >> #compositionWidthFor:."
> +
> + ^ numCharactersPerLine!
>
> Item was added:
> + ----- Method: TextMorph>>averageLineLength: (in category 'layout') -----
> + averageLineLength: numCharsOrNil
> + "Reset the receiver's composition rectangle to fit approx. numChars per line. For nil, it uses a sane default for English text. See commentary in #averageLineLength."
> +
> + numCharactersPerLine = numCharsOrNil ifTrue: [^ self].
> + numCharactersPerLine := numCharsOrNil.
> + self releaseParagraph; changed.!
>
>
>

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


More information about the Squeak-dev mailing list