The Trunk: Graphics-mt.405.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Graphics-mt.405.mcz

commits-2
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.405.mcz

==================== Summary ====================

Name: Graphics-mt.405
Author: mt
Time: 12 December 2018, 10:07:51.370544 am
UUID: de6add9e-f9c2-9a46-a50d-4a5c6d9450eb
Ancestors: Graphics-mt.404

Improvements on the recent addition (mt.404) of a new infix way to build rectangles around a center:

- rename #inflate: to #center: to match the "noun style" of #corner: and extent:
- for #center: treat the receiver as extent for readability
- add #origin: to have both infix ways where the receiver is the rectangle's extent
- change category for #corner:, #extent:, #center:, #origin:, and #rect: to "converting to rectangle" for discoverability

For the discussion, see http://forum.world.st/The-Trunk-Graphics-mt-404-mcz-td5090000.html

=============== Diff against Graphics-mt.404 ===============

Item was added:
+ ----- Method: Point>>center: (in category 'converting to rectangle') -----
+ center: aPoint
+ "Answer a Rectangle whose extent is the receiver and whose center is
+ aPoint. This is one of the infix ways of expressing the creation of a
+ rectangle."
+
+ ^Rectangle center: aPoint extent: self!

Item was changed:
+ ----- Method: Point>>corner: (in category 'converting to rectangle') -----
- ----- Method: Point>>corner: (in category 'converting') -----
  corner: aPoint
  "Answer a Rectangle whose origin is the receiver and whose corner is
  aPoint. This is one of the infix ways of expressing the creation of a
  rectangle."
 
  ^Rectangle origin: self corner: aPoint!

Item was changed:
+ ----- Method: Point>>extent: (in category 'converting to rectangle') -----
- ----- Method: Point>>extent: (in category 'converting') -----
  extent: aPoint
  "Answer a Rectangle whose origin is the receiver and whose extent is
  aPoint. This is one of the infix ways of expressing the creation of a
  rectangle."
 
  ^Rectangle origin: self extent: aPoint!

Item was removed:
- ----- Method: Point>>inflate: (in category 'converting') -----
- inflate: aPoint
- "Answer a Rectangle whose center is the receiver and whose extent is
- aPoint. This is one of the infix ways of expressing the creation of a
- rectangle."
-
- ^Rectangle center: self extent: aPoint!

Item was added:
+ ----- Method: Point>>origin: (in category 'converting to rectangle') -----
+ origin: aPoint
+ "Answer a Rectangle whose extent is the receiver and whose origin is
+ aPoint. This is one of the infix ways of expressing the creation of a
+ rectangle."
+
+ ^Rectangle origin: aPoint extent: self!

Item was changed:
+ ----- Method: Point>>rect: (in category 'converting to rectangle') -----
- ----- Method: Point>>rect: (in category 'converting') -----
  rect: aPoint
  "Answer a Rectangle that encompasses the receiver and aPoint.
  This is the most general infix way to create a rectangle."
 
  ^ Rectangle
  origin: (self min: aPoint)
  corner: (self max: aPoint)!