Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1613.mcz==================== Summary ====================
Name: Morphic-mt.1613
Author: mt
Time: 6 January 2020, 9:41:04.49243 am
UUID: 45d4b3c8-b251-2544-9e7e-411c30c1c217
Ancestors: Morphic-mt.1612
Fixes the updating bug in string morph. Clarifies some related code, too.
Thanks to Stéphane (spfa), Karl (kfr), and Dave (dtl) for the hints and suggestions!
=============== Diff against Morphic-mt.1612 ===============
Item was changed:
----- Method: StringMorph>>contents: (in category 'accessing') -----
contents: newContents
newContents isText
ifTrue: [^ self initializeFromText: newContents].
contents = newContents
+ ifTrue: [^ self "No substantive change."].
- ifTrue: [^ self "no substantive change"].
contents := newContents.
+ self changed. "New contents need to be drawn."
+
+ self fitContents. "Resize if necessary."!
-
- self fitContents.!
Item was changed:
----- Method: StringMorph>>fitContents (in category 'layout') -----
fitContents
+ self extent: self measureContents.!
- | newBounds boundsChanged |
- newBounds := self measureContents.
- boundsChanged := bounds extent ~= newBounds.
- self extent: newBounds. "default short-circuits if bounds not changed"
- boundsChanged ifFalse: [self changed]!
Item was changed:
----- Method: UpdatingStringMorph>>fitContents (in category 'layout') -----
fitContents
+ "Overridden to respect minimum and maximum widfth."
+
-
| newExtent |
+ newExtent := self measureContents.
+ self extent: ((newExtent x max: self minimumWidth) min: self maximumWidth) @ newExtent y.!
- newExtent := self measureContents.
- newExtent := ((newExtent x max: self minimumWidth) min: self maximumWidth) @ newExtent y.
- (self extent = newExtent) ifFalse:
- [self extent: newExtent.
- self changed]
- !
Item was changed:
----- Method: UpdatingStringMorph>>updateContentsFrom: (in category 'stepping') -----
updateContentsFrom: aValue
self growable
ifTrue:
+ [self contentsFitted: aValue]
- [self contents: aValue]
ifFalse:
[self contentsClipped: aValue]!