mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-08 20:01:30 +11:00
[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.
This commit is contained in:
parent
8bd1bdfaa8
commit
5ba2826460
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue