Andreas Raab uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-ar.86.mcz ==================== Summary ==================== Name: ST80-ar.86 Author: ar Time: 23 January 2010, 2:51:15.768 pm UUID: f6be286b-4c61-1444-b8a0-7e205b369609 Ancestors: ST80-ar.85, ST80-nice.80 Merging ST80-nice.80: 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 ST80-ar.85 =============== Item was changed: ----- Method: View>>defaultWindow (in category 'window access') ----- defaultWindow "Build the minimum Rectangle that encloses all the windows of the receiver's subViews. The answer is a Rectangle obtained by expanding this minimal Rectangle by the borderWidth of the receiver. If the receiver has no subViews, then a Rectangle enclosing the entire display screen is answered. It is used internally by View methods if no window has been specified for the View. Specialized subclasses of View should redefine View|defaultWindow to handle the default case for instances that have no subViews." | aRectangle | subViews isEmpty ifTrue: [^DisplayScreen boundingBox]. + aRectangle := self firstSubView viewport copy. + subViews do: [:aView | aRectangle swallow: aView viewport]. - aRectangle := self firstSubView viewport. - subViews do: [:aView | aRectangle := aRectangle merge: aView viewport]. ^aRectangle expandBy: borderWidth! Item was changed: ----- Method: View>>computeBoundingBox (in category 'display box access') ----- computeBoundingBox "Answer the minimum Rectangle that encloses the bounding boxes of the receiver's subViews. If the receiver has no subViews, then the bounding box is the receiver's window. Subclasses should redefine View|boundingBox if a more suitable default for the case of no subViews is available." | aRectangle | subViews isEmpty ifTrue: [^self getWindow]. + aRectangle := (self firstSubView transform: self firstSubView boundingBox) copy. - aRectangle := self firstSubView transform: self firstSubView boundingBox. subViews do: [:aView | + aRectangle swallow: (aView transform: aView boundingBox).]. - aRectangle := aRectangle merge: (aView transform: aView boundingBox).]. ^aRectangle expandBy: borderWidth! Item was changed: ----- Method: Path>>computeBoundingBox (in category 'display box access') ----- computeBoundingBox "Refer to the comment in DisplayObject|computeBoundingBox." | box | box := Rectangle origin: (self at: 1) extent: 0 @ 0. collectionOfPoints do: + [:aPoint | box swallow: (Rectangle origin: aPoint extent: 0 @ 0)]. - [:aPoint | box := box merge: (Rectangle origin: aPoint extent: 0 @ 0)]. ^box! |
Free forum by Nabble | Edit this page |