[squeak-dev] The Inbox: Graphics-cbc.372.mcz

H. Hirzel hannes.hirzel at gmail.com
Wed Mar 29 13:21:51 UTC 2017


What is the difference to the existing method ?

center: centerPoint extent: extentPoint
	"Answer an instance of me whose center is centerPoint and width
	by height is extentPoint.  "

	^self origin: centerPoint - (extentPoint//2) extent: extentPoint

Is / vs // worth the effort?

On Wed, 29 Mar 2017 00:18:24 0000, commits at source.squeak.org
<commits at source.squeak.org> wrote:
> A new version of Graphics was added to project The Inbox:
> http://source.squeak.org/inbox/Graphics-cbc.372.mcz
>
> ==================== Summary ====================
>
> Name: Graphics-cbc.372
> Author: cbc
> Time: 28 March 2017, 5:18:09.019402 pm
> UUID: 7b9783b1-87c5-3549-ac32-42acd6abcb12
> Ancestors: Graphics-eem.371
>
> Added method to allow creating a rectangle based on teh center of the
> rectangle.
>
> =============== Diff against Graphics-eem.371 ===============
>
> Item was added:
> + ----- Method: Rectangle class>>exactCenter:extent: (in category 'instance
> creation') -----
> + exactCenter: centerPoint extent: extentPoint
> + 	"Answer an instance of me whose center is centerPoint and width
> + 	by height is extentPoint. "
> + 	^ self origin: centerPoint - (extentPoint / 2) extent: extentPoint
> + !
>
>
>


More information about the Squeak-dev mailing list