The Trunk: ST80-nice.140.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-nice.140.mcz

commits-2
Nicolas Cellier uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-nice.140.mcz

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

Name: ST80-nice.140
Author: nice
Time: 20 January 2013, 9:28:27.766 pm
UUID: 3d04c80a-617b-4d5f-92b9-9993bee48d25
Ancestors: ST80-eem.139

Use degreesToRadians where due

=============== Diff against ST80-eem.139 ===============

Item was changed:
  ----- Method: Arc>>displayOn:at:clippingBox:rule:fillColor: (in category 'displaying') -----
  displayOn: aDisplayMedium at: aPoint clippingBox: clipRect rule: anInteger fillColor: aForm
 
  | nSegments line angle sin cos xn yn |
  nSegments := 12.0.
  line := Line new.
  line form: self form.
+ angle := (90.0 / nSegments) degreesToRadians.
+ sin := angle sin.
+ cos := angle cos.
- angle := 90.0 / nSegments.
- sin := (angle * (2 * Float pi / 360.0)) sin.
- cos := (angle * (2 * Float pi / 360.0)) cos.
  quadrant = 1
  ifTrue:
  [xn := radius asFloat.
  yn := 0.0].
  quadrant = 2
  ifTrue:
  [xn := 0.0.
  yn := 0.0 - radius asFloat].
  quadrant = 3
  ifTrue:
  [xn := 0.0 - radius asFloat.
  yn := 0.0].
  quadrant = 4
  ifTrue:
  [xn := 0.0.
  yn := radius asFloat].
  nSegments asInteger
  timesRepeat:
  [ | xn1 yn1 |
  xn1 := xn * cos + (yn * sin).
  yn1 := yn * cos - (xn * sin).
  line beginPoint: center + (xn asInteger @ yn asInteger).
  line endPoint: center + (xn1 asInteger @ yn1 asInteger).
  line
  displayOn: aDisplayMedium
  at: aPoint
  clippingBox: clipRect
  rule: anInteger
  fillColor: aForm.
  xn := xn1.
  yn := yn1]!