refactor: use new fn over raw struct initialization
This commit is contained in:
parent
5781a93c1f
commit
20f68eaa60
1 changed files with 1 additions and 1 deletions
|
|
@ -37,7 +37,7 @@ impl canvas::Program<app::Message, Theme, Renderer> for CpuGraph {
|
||||||
for (index, value) in self.timeline.iter().enumerate() {
|
for (index, value) in self.timeline.iter().enumerate() {
|
||||||
let x = index as f32 / self.timeline.len() as f32 * bounds.width;
|
let x = index as f32 / self.timeline.len() as f32 * bounds.width;
|
||||||
let y = bounds.height - value / 100. * bounds.height;
|
let y = bounds.height - value / 100. * bounds.height;
|
||||||
builder.line_to(Point { x, y })
|
builder.line_to(Point::new(x, y))
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
canvas::Stroke::default().with_color(CYAN),
|
canvas::Stroke::default().with_color(CYAN),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue