Skip to content

Commit

Permalink
Added back some essential methods in Rectangle. It seems that these…
Browse files Browse the repository at this point in the history
… methods were lost
  • Loading branch information
bergel committed Oct 15, 2020
1 parent 6f86398 commit 44f641f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Kernel/Rectangle.class.st
Expand Up @@ -48,6 +48,13 @@ Rectangle class >> encompassing: listOfPoints [
^ topLeft corner: bottomRight
]

{ #category : #'instance creation' }
Rectangle class >> floatCenter: centerPoint extent: extentPoint [
"Answer an instance of me whose center is centerPoint and width
by height is extentPoint."
^self origin: centerPoint - (extentPoint/2.0) extent: extentPoint
]

{ #category : #'instance creation' }
Rectangle class >> left: left right: right top: top bottom: bottom [
"Answer an instance of me whose left, right, top, and bottom coordinates
Expand Down Expand Up @@ -450,6 +457,12 @@ Rectangle >> flipBy: direction centerAt: aPoint [
rectangle: (corner flipBy: direction centerAt: aPoint)
]

{ #category : #accessing }
Rectangle >> floatCenter [
"Answer the float point at the center of the receiver."
^ self topLeft + self bottomRight / 2.0
]

{ #category : #'truncation and roundoff' }
Rectangle >> floor [
"Answer the integer rectangle to the topLeft of receiver.
Expand Down

0 comments on commit 44f641f

Please sign in to comment.