'From Squeak3.2alpha of 4 October 2001 [latest update: #4474] on 9 November 2001 at 6:07:30 pm'! "Change Set: TextMorphResizeSel-dew Date: 9 November 2001 Author: Doug Way Fixes TextMorph to retain the current selection and other editor information when its extent is changed. This should prevent the selection from being reset by merely typing into TextMorphs in dynamic layouts. To verify the fix, open a TextMorph, type in a few words, highlight one word, resize the TextMorph so that the word wrap changes and note that the selection remains intact. (An update of Jesse Welton's earlier TinyTextMorphFix.)"! !TextMorph methodsFor: 'geometry' stamp: 'dew 11/9/2001 18:01'! extent: aPoint | newExtent priorEditor | priorEditor _ editor. self isAutoFit ifTrue: [wrapFlag ifFalse: [^ self]. "full autofit can't change" newExtent _ aPoint truncated max: self minimumExtent. newExtent x = self extent x ifTrue: [^ self]. "No change of wrap width" self releaseParagraph. "invalidate the paragraph cache" super extent: newExtent. priorEditor ifNil: [self fit] "since the width has changed..." ifNotNil: [self installEditorToReplace: priorEditor]] ifFalse: [super extent: (aPoint truncated max: self minimumExtent). wrapFlag ifFalse: [^ self]. "no effect on composition" self composeToBounds] ! !