mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-09 12:21:31 +11:00
[frame_stats] Use match statement for color coding graph
This commit is contained in:
parent
6f3051837f
commit
703d22f4b7
|
@ -121,19 +121,18 @@ impl Snapshot {
|
||||||
let sample_ms = ((*sample as f64) * 0.001).min(display_max);
|
let sample_ms = ((*sample as f64) * 0.001).min(display_max);
|
||||||
let h = sample_ms / display_max;
|
let h = sample_ms / display_max;
|
||||||
let s = Affine::scale_non_uniform(1., -h);
|
let s = Affine::scale_non_uniform(1., -h);
|
||||||
|
let color = match *sample {
|
||||||
|
..=16_667 => Color::rgb8(100, 143, 255),
|
||||||
|
..=33_334 => Color::rgb8(255, 176, 0),
|
||||||
|
_ => Color::rgb8(220, 38, 127),
|
||||||
|
};
|
||||||
sb.fill(
|
sb.fill(
|
||||||
Fill::NonZero,
|
Fill::NonZero,
|
||||||
t * Affine::translate((
|
t * Affine::translate((
|
||||||
left_margin_padding,
|
left_margin_padding,
|
||||||
(1 + labels.len()) as f64 * text_height,
|
(1 + labels.len()) as f64 * text_height,
|
||||||
)) * s,
|
)) * s,
|
||||||
if *sample < 16667 {
|
color,
|
||||||
Color::rgb8(100, 143, 255)
|
|
||||||
} else if *sample < 33334 {
|
|
||||||
Color::rgb8(255, 176, 0)
|
|
||||||
} else {
|
|
||||||
Color::rgb8(220, 38, 127)
|
|
||||||
},
|
|
||||||
None,
|
None,
|
||||||
&bar,
|
&bar,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue