The Trunk: ST80-mt.268.mcz

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

The Trunk: ST80-mt.268.mcz

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

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

Name: ST80-mt.268
Author: mt
Time: 15 April 2021, 3:34:51.487875 pm
UUID: d6b9c2fc-1c08-460f-ac5f-52dfe1a2d02d
Ancestors: ST80-mt.267, ST80-ct.240

Merges ST80-ct.240, which is a dependency of some things in MorphicExtras, I am about to merge soon.

(Not sure whether this version is complete. It describes some refactorings and speed-up, which is not present in this inbox version.)

=============== Diff against ST80-mt.267 ===============

Item was added:
+ ----- Method: Arc class>>center:radius:quadrant: (in category 'instance creation') -----
+ center: aPoint radius: anInteger quadrant: section
+
+ ^ self new
+ center: aPoint radius: anInteger quadrant: section;
+ yourself!

Item was added:
+ ----- Method: Arc>>computeVertices: (in category 'displaying') -----
+ computeVertices: size
+
+ | dAngle dSin dCos point |
+ dAngle := (90 / (size - 1)) degreesToRadians.
+ dSin := dAngle sin.
+ dCos := dAngle cos.
+ point := (1 to: quadrant)
+ inject: 0 @ radius
+ into: [:p :i | p leftRotated].
+ ^ (OrderedCollection new: size)
+ add: (center + point) rounded;
+ addAll: ((1 to: size - 1) collect: [:i |
+ point := point * dCos + (point * dSin) leftRotated.
+ (center + point) rounded]);
+ yourself!