From 5ba28264604d337405bbb00909d80a4849ce1e7e Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Tue, 21 Mar 2023 10:30:02 -0700 Subject: [PATCH] [frame_stats] Scale the frame time graph linearly The sqrt scale doesn't add much value any more since the max frame time can be reset with a keypress. --- examples/with_winit/src/stats.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/with_winit/src/stats.rs b/examples/with_winit/src/stats.rs index 76c3e04..e9f1bf3 100644 --- a/examples/with_winit/src/stats.rs +++ b/examples/with_winit/src/stats.rs @@ -105,11 +105,8 @@ impl Snapshot { for (i, sample) in samples.enumerate() { let t = offset * Affine::translate((i as f64 * bar_extent, graph_max_height)); // The height of each sample is based on its ratio to the maximum observed frame time. - // Currently this maximum scale is sticky and a high temporary spike will permanently - // shrink the draw size of the overall average sample, so scale the size non-linearly to - // emphasize smaller samples. let h = (*sample as f64) * 0.001 / self.frame_time_max_ms; - let s = Affine::scale_non_uniform(1., -h.sqrt()); + let s = Affine::scale_non_uniform(1., -h); sb.fill( Fill::NonZero, t * Affine::translate((left_margin, (1 + labels.len()) as f64 * text_height)) * s,