Skip to content

Commit

Permalink
Add a guard in TimerElement
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Jun 12, 2024
1 parent ae640f5 commit 51fb8ef
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
initialization
initializeAnimation

| started |
anim := BlAnimation new
duration: 1 seconds;
loops: value.
started := false.

self addEventHandlerOn: BlMouseDownEvent do: [ :a |
started ifFalse: [
started := true.
anim addEventHandler: (BlEventHandler
on: BlAnimationLoopDoneEvent
do: [ :e |
currentAngle := currentAngle - decreasingAngleStep.
self updateAnnulusAngle: currentAngle.
self updateValue.
self background: Color random ]) ].
self background: Color random ]) ]] .

self addAnimation: anim

0 comments on commit 51fb8ef

Please sign in to comment.