[squeak-dev] The Trunk: Morphic-mt.1850.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jan 19 16:53:29 UTC 2022
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1850.mcz
==================== Summary ====================
Name: Morphic-mt.1850
Author: mt
Time: 19 January 2022, 5:53:24.171517 pm
UUID: 8082e7e8-3dc5-8f49-95f3-217c08b6e59a
Ancestors: Morphic-mt.1849
Complements Graphics-mt.462.
=============== Diff against Morphic-mt.1849 ===============
Item was changed:
----- Method: TextMorph>>fit (in category 'private') -----
fit
"Adjust my bounds to fit the text. Should be a no-op if autoFit is not specified.
Required after the text changes,
or if wrapFlag is true and the user attempts to change the extent."
| newExtent para cBounds lastOfLines heightOfLast |
self isAutoFit
ifTrue:
[
+ newExtent := self paragraph extent.
- newExtent := self paragraph extent max: 1 @ self defaultLineHeight.
newExtent := newExtent + (2 * self borderWidth).
margins
ifNotNil: [newExtent := ((0 @ 0 extent: newExtent) expandBy: margins) extent].
newExtent ~= bounds extent
ifTrue:
[(container isNil and: [successor isNil])
ifTrue:
[para := paragraph. "Save para (layoutChanged smashes it)"
super extent: newExtent.
paragraph := para]].
container notNil & successor isNil
ifTrue:
[cBounds := container bounds truncated.
"23 sept 2000 - try to allow vertical growth"
lastOfLines := self paragraph lines last.
heightOfLast := lastOfLines bottom - lastOfLines top.
(lastOfLines last < text size
and: [lastOfLines bottom + heightOfLast >= self bottom])
ifTrue:
[container releaseCachedState.
cBounds := cBounds origin corner: cBounds corner + (0 @ heightOfLast)].
self privateBounds: cBounds]].
"These statements should be pushed back into senders"
self paragraph positionWhenComposed: self position.
successor ifNotNil: [successor predecessorChanged].
self changed "Too conservative: only paragraph composition
should cause invalidation."!
Item was changed:
----- Method: TextMorph>>minHeight (in category 'layout') -----
minHeight
| result |
+ textStyle ifNil: [^ TextStyle defaultFont height].
- textStyle ifNil: [^ 16].
+ result := (paragraph
+ ifNil: [textStyle lineGrid]
+ ifNotNil: [paragraph lines first lineHeight])
+ + (self borderWidth*2).
- result := (textStyle lineGrid + 2) + (self borderWidth*2).
margins ifNil: [^ result].
^ margins isRectangle
ifTrue: [result + margins top + margins bottom]
ifFalse: [margins isPoint
ifTrue: [result + margins y + margins y]
ifFalse: [result + (2*margins)]]!
Item was changed:
----- Method: TextMorph>>minWidth (in category 'layout') -----
minWidth
| result |
+ textStyle ifNil: [^ (TextStyle defaultFont widthOf: $x)].
- textStyle ifNil: [^ 9].
+ result := (textStyle defaultFont widthOf: $x) + (self borderWidth*2).
- result := 9 + (self borderWidth*2).
margins ifNil: [^ result].
^ margins isRectangle
ifTrue: [result + margins left + margins right]
ifFalse: [margins isPoint
ifTrue: [result + margins x + margins x]
ifFalse: [result + (2*margins)]]!
More information about the Squeak-dev
mailing list
|