'From etoys2.3 of 2 December 2007 [latest update: #1883] on 30 January 2008 at 12:32:08 pm'! "Change Set: NarrowTab-tk Date: 30 January 2008 Author: Ted Kaehler The Tabs were all too wide. Undo update 1870defaultLineHeight that made all TextMorphs very wide. If more than 2 characters, let it be as narrow as it wants."! !TextMorph methodsFor: 'private' stamp: 'tk 1/30/2008 12:28'! 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 wid | self isAutoFit ifTrue: [wid _ text size > 2 ifTrue: [5] ifFalse: [40]. newExtent := (self paragraph extent max: wid @ ( 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."! !