diff --git a/src/Kernel/Rectangle.class.st b/src/Kernel/Rectangle.class.st index 943d5fb2729..8b654196156 100644 --- a/src/Kernel/Rectangle.class.st +++ b/src/Kernel/Rectangle.class.st @@ -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 @@ -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.