[ENH] lower overhead for thumbnails

Bob Arning arning at charm.net
Fri Dec 10 15:03:46 UTC 1999


I found that while playing with Drive a Car, it was a lot harder to draw the steering wheel (i.e. it became rather sluggish) if the car had been rotated first (and a viewer was open on the car). The culprit was the ThumbnailMorph which was fooled by the presence of a TransformationMorph into redrawing at every opportunity. By ignoring the TransformationMorph and watching the SketchMorph inside, this burden is considerably reduced and the system is more responsive. The down side (a matter of taste) is that the thumbnail now shows an upright image of the viewee even if the viewee is rotated.

Cheers,
Bob

========
'From Squeak2.7alpha of 9 November 1999 [latest update: #1698] on 10 December 1999 at 9:55:57 am'!
"Change Set:		thumbSpeed
Date:			10 December 1999
Author:			Bob Arning

- reduce unnecessary redrawing of thumbnails by ignoring flex (if any) applied to the viewed morph"!


!ThumbnailMorph methodsFor: 'as yet unclassified' stamp: 'RAA 12/10/1999 09:52'!
actualViewee
	"Return the actual morph to be viewed, or nil if there isn't an appropriate morph to view."

	| aMorph actualViewee |
	aMorph _ self morphToView ifNil: [^ nil]. 
	aMorph isInWorld ifFalse: [^ nil].
	actualViewee _ viewSelector ifNil: [aMorph] ifNotNil: [objectToView perform: viewSelector].
	actualViewee == 0 ifTrue: [^ nil].  "valueAtCursor result for an empty HolderMorph"
	actualViewee ifNil: [actualViewee _ objectToView].
	actualViewee isMorph ifFalse: [actualViewee _ actualViewee costume].
	(actualViewee isMorph and: [actualViewee isFlexMorph and: 
										[actualViewee submorphs size = 1]]) ifTrue: [
		actualViewee _ actualViewee firstSubmorph
	].
	^ actualViewee
! !





More information about the Squeak-dev mailing list