Andreas Raab uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ar.72.mcz==================== Summary ====================
Name: MorphicExtras-ar.72
Author: ar
Time: 23 January 2010, 2:50:05.444 pm
UUID: e8ecb63e-4699-974e-9af9-bb7b9a0c1e9c
Ancestors: MorphicExtras-dtl.71, MorphicExtras-nice.65
Merging MorphicExtras-nice.65:
Experimental: let a Rectangle merge in place (I called this swallow:)
This has two advantages:
- avoid repeated Object creation when we just want the gross result
- avoid closures writing to outer temps
IMHO, generalizing this kind of policy could have a measurable impact on GUI speed.
However, this is against current policy to never change a Point nor rectangle in place, so I let gurus judge if worth or not.
=============== Diff against MorphicExtras-dtl.71 ===============
Item was changed:
----- Method: BackgroundMorph>>subBounds (in category 'accessing') -----
subBounds
"calculate the submorph bounds"
| subBounds |
+ subBounds := (submorphs ifEmpty: [^nil]) anyOne fullBounds copy.
+ self submorphsDo: [:m | subBounds swallow: m fullBounds].
- subBounds := nil.
- self submorphsDo:
- [:m |
- subBounds := subBounds isNil
- ifTrue: [m fullBounds]
- ifFalse: [subBounds merge: m fullBounds]].
^subBounds!