Simplify tick drawing logic in clock example
This commit is contained in:
parent
10e5362c04
commit
d9a732994f
1 changed files with 1 additions and 3 deletions
|
|
@ -182,9 +182,7 @@ impl<Message> canvas::Program<Message> for Clock {
|
||||||
|
|
||||||
// Draw ticks
|
// Draw ticks
|
||||||
for tick in 0..60 {
|
for tick in 0..60 {
|
||||||
let angle = Radians::from(hand_rotation(tick, 60))
|
let angle = hand_rotation(tick, 60);
|
||||||
- Radians::from(Degrees(90.0));
|
|
||||||
|
|
||||||
let width = if tick % 5 == 0 { 3.0 } else { 1.0 };
|
let width = if tick % 5 == 0 { 3.0 } else { 1.0 };
|
||||||
|
|
||||||
frame.with_save(|frame| {
|
frame.with_save(|frame| {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue