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

commits at source.squeak.org commits at source.squeak.org
Fri Mar 4 08:44:38 UTC 2022

Marcel Taeumel uploaded a new version of Morphic to project The Trunk:

==================== Summary ====================

Name: Morphic-mt.1921
Author: mt
Time: 4 March 2022, 9:44:29.912012 am
UUID: 6ab07605-527d-ab40-bb4d-8fd5ec253cd4
Ancestors: Morphic-mt.1920

Prepare somewhat of a workaround for awkward paragraph re-composition when the paragraph's container is smaller than a single glyph but those glyphs allow for line breaks, which is the normal case, e.g., in Japanese fonts. (Note that the Western default is break-on-space.)

When does this happen? Think of an empty text morph where you start typing something. But instead of typing, you paste something from the clipboard. This is where it breaks, e.g., for Japanese fonts.

What happens in that case is that the paragraph composition "explodes" downward until the maximum height is reached. The user will notice an input lag.

I will try to hunt down the actual issue but for now it makes sense to communicate the min-width from the TextMorph to the paragraph.

=============== Diff against Morphic-mt.1920 ===============

Item was added:
+ ----- Method: NewParagraph>>adjustRightXDownTo: (in category 'private') -----
+ adjustRightXDownTo: minWidth
+ 	| shrink |
+ 	shrink := container right - maxRightX.
+ 	lines do: [:line | line paddingWidth: (line paddingWidth - shrink)].
+ 	container := container withRight: (maxRightX + self caretWidth max: minWidth).!

Item was added:
+ ----- Method: TextMorph>>minCompositionHeight (in category 'layout') -----
+ minCompositionHeight
+ 	^ (textStyle ifNil: [TextStyle default]) lineGrid!

Item was added:
+ ----- Method: TextMorph>>minCompositionWidth (in category 'layout') -----
+ minCompositionWidth
+ 	^ ((textStyle ifNil: [TextStyle default]) defaultFont widthOf: $x) * 2!

More information about the Squeak-dev mailing list