'From Squeak3.1alpha [latest update: #''Squeak3.1alpha'' of 28 February 2001 update 3942] on 21 April 2001 at 10:31:39 pm'! "Change Set: HideFlap-ar Date: 21 April 2001 Author: Andreas Raab Make sure viewers go away whenever we start to paint not only when invoked through the painting flap."! !SketchEditorMorph methodsFor: 'initialization' stamp: 'ar 4/21/2001 22:29'! initializeFor: aSketchMorph inBounds: boundsToUse pasteUpMorph: aPasteUpMorph | aPaintBox newPaintBoxBounds worldBounds requiredWidth newOrigin aPosition aPal aTab paintBoxFullBounds | aPasteUpMorph hideViewerFlaps. (aTab _ self world paintingFlapTab) ifNotNil: [aTab showFlap. ^ self initializeFor: aSketchMorph inBounds: boundsToUse pasteUpMorph: aPasteUpMorph paintBoxPosition: nil]. aPaintBox _ self world paintBox. worldBounds _ self world bounds. requiredWidth _ aPaintBox width. aPosition _ (aPal _ aPasteUpMorph standardPalette) ifNotNil: [aPal showNoPalette. aPal topRight + (aPaintBox width negated @ 0 "aPal tabsMorph height")] ifNil: [boundsToUse topRight]. newOrigin _ ((aPosition x + requiredWidth <= worldBounds right) or: [Preferences unlimitedPaintArea]) ifTrue: "will fit to right of aPasteUpMorph" [aPosition] ifFalse: "won't fit to right, try left" [boundsToUse topLeft - (requiredWidth @ 0)]. paintBoxFullBounds _ aPaintBox maxBounds. paintBoxFullBounds _ (newOrigin - aPaintBox offsetFromMaxBounds) extent: paintBoxFullBounds extent. newPaintBoxBounds _ paintBoxFullBounds translatedToBeWithin: worldBounds. self initializeFor: aSketchMorph inBounds: boundsToUse pasteUpMorph: aPasteUpMorph paintBoxPosition: newPaintBoxBounds origin + aPaintBox offsetFromMaxBounds.! !