The Inbox: Graphics-ct.420.mcz

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

The Inbox: Graphics-ct.420.mcz

commits-2
A new version of Graphics was added to project The Inbox:
http://source.squeak.org/inbox/Graphics-ct.420.mcz

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

Name: Graphics-ct.420
Author: ct
Time: 20 September 2019, 7:51:45.343726 pm
UUID: 639154ec-e7c5-1346-8da0-e2180c88613e
Ancestors: Graphics-ct.419

Add random functions for Rectangle

Try out: [Morph new openInWorld; center: World bounds randomPoint]

=============== Diff against Graphics-ct.419 ===============

Item was added:
+ ----- Method: Rectangle>>randomPoint (in category 'random') -----
+ randomPoint
+
+ ^ self randomPoint: Random new!

Item was added:
+ ----- Method: Rectangle>>randomPoint: (in category 'random') -----
+ randomPoint: aGenerator
+
+ ^ self pointAtFraction: aGenerator next @ aGenerator next!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Graphics-ct.420.mcz

marcel.taeumel
Looking at Integer >> #atRandom and Collection >> #atRandom, we should use "ThreadSafeRandom value" all the time? :-)

Best,
Marcel

Am 20.09.2019 19:52:06 schrieb [hidden email] <[hidden email]>:

A new version of Graphics was added to project The Inbox:
http://source.squeak.org/inbox/Graphics-ct.420.mcz

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

Name: Graphics-ct.420
Author: ct
Time: 20 September 2019, 7:51:45.343726 pm
UUID: 639154ec-e7c5-1346-8da0-e2180c88613e
Ancestors: Graphics-ct.419

Add random functions for Rectangle

Try out: [Morph new openInWorld; center: World bounds randomPoint]

=============== Diff against Graphics-ct.419 ===============

Item was added:
+ ----- Method: Rectangle>>randomPoint (in category 'random') -----
+ randomPoint
+
+ ^ self randomPoint: Random new!

Item was added:
+ ----- Method: Rectangle>>randomPoint: (in category 'random') -----
+ randomPoint: aGenerator
+
+ ^ self pointAtFraction: aGenerator next @ aGenerator next!