[squeak-dev] The Trunk: MorphicExtras-ct.332.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 13 08:43:29 UTC 2022
Christoph Thiede uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ct.332.mcz
==================== Summary ====================
Name: MorphicExtras-ct.332
Author: ct
Time: 13 September 2022, 10:43:26.542293 am
UUID: b8569da9-9d0e-2d40-9b14-c72daf1534be
Ancestors: MorphicExtras-ct.331
Makes tick indicator high-dpi-sensitive.
=============== Diff against MorphicExtras-ct.331 ===============
Item was changed:
----- Method: TickIndicatorMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
| r center cc deg |
super drawOn: aCanvas.
corners ifNil:[
+ r := (bounds topCenter - bounds center) r - 2 px.
- r := (bounds topCenter - bounds center) r - 2.
corners := Array new: 32.
1 to: corners size do:[:i|
deg := 360.0 / corners size * (i-1).
corners at: i put: (Point r: r degrees: deg-90) asIntegerPoint]].
index := index \\ corners size.
cc := color darker.
center := bounds center.
1 to: corners size by: 4 do:[:i|
+ aCanvas fillRectangle: (center + (corners at: i)-2 extent: 4 px @ 4 px) color: cc.
- aCanvas fillRectangle: (center + (corners at: i)-2 extent: 4 at 4) color: cc.
].
cc := cc darker.
+ aCanvas line: center to: center + (corners at: index + 1) width: 2 px color: cc.!
- aCanvas line: center to: center + (corners at: index + 1) width: 2 color: cc.!
Item was changed:
----- Method: TickIndicatorMorph>>extent: (in category 'geometry') -----
extent: aPoint
+ super extent: ((aPoint x max: aPoint y) roundDownTo: 4 px) asPoint.
- super extent: ((aPoint x max: aPoint y) asInteger bitClear: 3) asPoint.
corners := nil.!
Item was changed:
----- Method: TickIndicatorMorph>>initialize (in category 'initialization') -----
initialize
"initialize the state of the receiver"
super initialize.
""
+ self extent: 30 px @ 30 px.
- self extent: 30 @ 30.
index := 0!
More information about the Squeak-dev
mailing list
|