[squeak-dev] The Inbox: Graphics-kfr.434.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Jul 11 08:18:16 UTC 2020
A new version of Graphics was added to project The Inbox:
http://source.squeak.org/inbox/Graphics-kfr.434.mcz
==================== Summary ====================
Name: Graphics-kfr.434
Author: kfr
Time: 11 July 2020, 10:18:06.272175 am
UUID: 0e0125f6-3040-6247-9e5a-43bfd1896f84
Ancestors: Graphics-mt.433
I wanted to subclass Rectangle with a instance variable to carry some state, but these methodes indirected to Point>>corner: so it broke the override and returned a ordinary Rectangle instead of my fancy new subclass SuperRectangle
=============== Diff against Graphics-mt.433 ===============
Item was changed:
----- Method: Rectangle class>>encompassing: (in category 'instance creation') -----
encompassing: listOfPoints
"A number of callers of encompass: should use this method."
| topLeft bottomRight |
topLeft := bottomRight := nil.
listOfPoints do:
[:p | topLeft == nil
ifTrue: [topLeft := bottomRight := p]
ifFalse: [topLeft := topLeft min: p.
bottomRight := bottomRight max: p]].
+ ^self origin: topLeft corner: bottomRight!
- ^ topLeft corner: bottomRight!
Item was changed:
----- Method: Rectangle class>>merging: (in category 'instance creation') -----
merging: listOfRects
"A number of callers of merge: should use this method."
| minX minY maxX maxY |
listOfRects
do: [:r | minX
ifNil: [minX := r topLeft x. minY := r topLeft y.
maxX := r bottomRight x. maxY := r bottomRight y]
ifNotNil: [minX := minX min: r topLeft x. minY := minY min: r topLeft y.
maxX := maxX max: r bottomRight x. maxY := maxY max: r bottomRight y]].
+ ^ self origin:minX at minY corner: maxX at maxY!
- ^ minX at minY corner: maxX at maxY!
More information about the Squeak-dev
mailing list
|