'From Squeak 2.5 of August 6, 1999 on 25 August 1999 at 3:28:27 am'! "Change Set: TextMorphScrollFix-dew Date: 25 August 1999 Author: Doug Way Fixes a problem in which Text objects with embedded morphs initially create a scrollable area which is 1000 pixels too tall. (As an example, Scamper benefits from this... the initial scrollable area for web pages is now correct.) This doesn't try to fix the potential equivalent problem with horizontal scrolling, though."! !TextMorph methodsFor: 'accessing' stamp: 'dew 8/25/1999 03:28'! newContents: stringOrText "Accept new text contents." | newText | newText _ stringOrText asText. text = newText ifTrue: [^ self]. "No substantive change" text ifNotNil: [ text embeddedMorphs do: [ :m | m delete ] ]. text _ newText. "add all morphs off the visible region; they'll be moved into the right place when they become visible. (this can make the scrollable area too large, though)" stringOrText asText embeddedMorphs do: [ :m | self addMorph: m. m position: (-1000@0)]. self releaseParagraph. "update the paragraph cache" self paragraph. "re-instantiate to set bounds" self world ifNotNil: [ self world startSteppingSubmorphsOf: self ]. ! !