[squeak-dev] The Trunk: MorphicExtras-tpr.339.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 16 00:11:54 UTC 2023


tim Rowledge uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-tpr.339.mcz

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

Name: MorphicExtras-tpr.339
Author: tpr
Time: 15 January 2023, 4:10:49.267391 pm
UUID: 987243c3-9188-4b77-a7d8-48b05eaf17f5
Ancestors: MorphicExtras-ct.338

Fix the BlobMorph to not trigger a deprecation warning inTestRunner

=============== Diff against MorphicExtras-ct.338 ===============

Item was changed:
  ----- Method: BlobMorph>>limitRange: (in category 'stepping') -----
  limitRange: verts
  	" limit radius to range 20-120; limit interpoint angle to surrounding angles with max of twice of average separation. "
  	| cent new prevn nextn prevDeg nextDeg thisDeg dincr |
  
  	cent := self bounds center.
  	new := Array new: verts size.
  	dincr := 360 // verts size.
+ 	verts withIndexDo:  [ :pt :n |
- 	verts doWithIndex: [ :pt :n |
  
  		"Find prev/next points, allowing for wrapping around "
  		prevn := n-1 < 1 ifTrue: [new size] ifFalse: [n-1].
  		nextn := n+1 > new size ifTrue: [1] ifFalse: [n+1].
  
  		"Get prev/this/next point's angles "
  		prevDeg := ((verts at: prevn)-cent) degrees.
  		thisDeg := ((verts at: n)-cent) degrees.
  		nextDeg := ((verts at: nextn)-cent) degrees.
  
  		"Adjust if this is where angles wrap from 0 to 360"
  		(thisDeg - prevDeg) abs > 180 ifTrue: [ prevDeg := prevDeg - 360 ].
  		(thisDeg - nextDeg) abs > 180 ifTrue: [ nextDeg := nextDeg + 360 ].
  
  		"Put adjusted point into new collection"
  		new at: n put: cent +
  			(self selfPolarPointRadius: ((((pt - cent) r) min: 80) max: 20)
  				degrees: (((thisDeg min: nextDeg-5) max: prevDeg+5) min: dincr*2+prevDeg)) ].
  	^ new
  !



More information about the Squeak-dev mailing list