Simplify tick drawing logic in clock example

This commit is contained in:
Héctor Ramón Jiménez 2025-01-16 12:17:28 +00:00
parent 10e5362c04
commit d9a732994f
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -182,9 +182,7 @@ impl<Message> canvas::Program<Message> for Clock {
// Draw ticks
for tick in 0..60 {
let angle = Radians::from(hand_rotation(tick, 60))
- Radians::from(Degrees(90.0));
let angle = hand_rotation(tick, 60);
let width = if tick % 5 == 0 { 3.0 } else { 1.0 };
frame.with_save(|frame| {