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

Tim Johnson digit at sonic.net
Tue Apr 12 05:25:05 UTC 2022


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.!
> 
> 
> 



More information about the Squeak-dev mailing list