Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Rewrite a method
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchodias committed Dec 30, 2022
1 parent 3934288 commit f96a4b5
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/Spec-Brick-Examples-Boids/BoidsCustomDrawSkyElement.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"
I'm an example of drawing boids simulation by overriding #drawOnSpartaCanvas:
I'm an example of drawing boids simulation by overriding canvas drawing hooks.
See an example on class side.
"
Expand Down Expand Up @@ -30,18 +30,19 @@ BoidsCustomDrawSkyElement >> aeDrawGeometryOn: aeCanvas [
{ #category : #'drawing - Alexandrie' }
BoidsCustomDrawSkyElement >> aeDrawOn: aeCanvas bodyOf: aBoid [

aeCanvas pathFactory: [ :cairoContext |
cairoContext
circleCenterX: aBoid position x
y: aBoid position y
radius: aBoid radius ].
aeCanvas setBackgroundWith: [
aeCanvas setSourceColor: aBoid color ].
aeCanvas setOutskirtsCentered.
aeCanvas setBorderBlock: [
aeCanvas setSourceColor: aBoid color muchDarker.
aeCanvas setBorderWidth: 1 ].
aeCanvas drawFigure.
aeCanvas
pathFactory: [ :cairoContext |
cairoContext
circleCenterX: aBoid position x
y: aBoid position y
radius: aBoid radius ];
setBackgroundWith: [
aeCanvas setSourceColor: aBoid color ];
setOutskirtsCentered;
setBorderBlock: [
aeCanvas setSourceColor: aBoid color muchDarker.
aeCanvas setBorderWidth: 1 ];
drawFigure

]

Expand Down

0 comments on commit f96a4b5

Please sign in to comment.