'From Squeak3.3alpha of 30 January 2002 [latest update: #4827] on 19 April 2002 at 8:50:30 am'! "Change Set: TransformBoundsFix-nk Date: 12 April 2002 Author: Ned Konz TransformMorphs reported their submorphBounds in local coordinates, rather than global coordinates. This can affect layout and bounds calculations for other morphs. This change set fixes that problem."! !ScrollPane methodsFor: 'geometry' stamp: 'nk 4/12/2002 13:43'! leftoverScrollRange "Return the entire scrolling range minus the currently viewed area." scroller localSubmorphBounds ifNil: [^ 0]. ^ (self totalScrollRange - bounds height roundTo: self scrollDeltaHeight) max: 0 ! ! !ScrollPane methodsFor: 'geometry' stamp: 'nk 4/12/2002 13:53'! unadjustedScrollRange "Return the height extent of the receiver's submorphs." | submorphBounds | submorphBounds := scroller localSubmorphBounds ifNil: [^ 0]. ^ submorphBounds bottom ! ! !TransformMorph methodsFor: 'geometry' stamp: 'nk 4/12/2002 14:02'! localSubmorphBounds "Answer, in my coordinate system, the bounds of all my submorphs (or nil if no submorphs)" | subBounds | subBounds _ nil. self submorphsDo: [:m | subBounds ifNil: [subBounds _ m fullBounds] ifNotNil: [subBounds _ subBounds quickMerge: m fullBounds]]. ^ subBounds! ! !TransformMorph methodsFor: 'geometry' stamp: 'nk 4/12/2002 14:02'! localVisibleSubmorphBounds "Answer, in my coordinate system, the bounds of all my visible submorphs (or nil if no visible submorphs)" | subBounds | subBounds _ nil. self submorphsDo: [:m | (m visible) ifTrue: [ subBounds ifNil: [subBounds _ m fullBounds copy] ifNotNil: [subBounds _ subBounds quickMerge: m fullBounds]] ]. ^subBounds! ! !TransformMorph methodsFor: 'geometry' stamp: 'nk 4/12/2002 14:03'! submorphBounds "Answer, in owner coordinates, the bounds of my visible submorphs, or my bounds" | box | box _ self localVisibleSubmorphBounds. ^(box ifNotNil: [ transform localBoundsToGlobal: box ] ifNil: [ self bounds ]) truncated. ! ! !TwoWayScrollPane methodsFor: 'geometry' stamp: 'nk 4/12/2002 14:00'! fitContents "Adjust my size to fit my contents reasonably snugly" self extent: scroller submorphBounds extent + (yScrollBar width @ xScrollBar height) + (borderWidth*2) ! ! !TwoWayScrollPane methodsFor: 'geometry' stamp: 'nk 4/12/2002 14:06'! totalScrollRange "Return the entire scrolling range." ^ ((scroller localVisibleSubmorphBounds ifNil: [^nil]) encompass: 0@0) extent ! ! TransformMorph removeSelector: #contentBounds!