'From etoys2.2 of 16 November 2007 [latest update: #1796] on 2 December 2007 at 2:21:49 pm'! "Change Set: TextMorph defaultLineHeight Date: 2 December 2007 Author: Karl Ramberg When all chars in a TextMorph was deleted the morph would become tiny. Here is a fix. This fix is not tested very much !!!!!!"! !TextMorph methodsFor: 'geometry' stamp: 'kfr 12/2/2007 13:47'! defaultLineHeight ^ ( textStyle fontAt: textStyle defaultFontIndex) pointSize! ! !TextMorph methodsFor: 'geometry' stamp: 'kfr 12/2/2007 14:19'! minimumExtent | minExt | textStyle ifNil: [^ 9@16]. borderWidth ifNil: [^ 9@16]. minExt _ (9@(self defaultLineHeight+2)) + (borderWidth*2). margins ifNil: [^ minExt]. ^ ((0@0 extent: minExt) expandBy: margins) extent! ! !TextMorph methodsFor: 'private' stamp: 'kfr 12/2/2007 13:48'! 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 max: 40 @ ( self defaultLineHeight)) + (0 @ 2). newExtent := newExtent + (2 * 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."! !