diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2025-09-12 01:47:49 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2025-09-12 01:47:49 -0700 |
commit | 766710c1d5a8c02ed625b7dc36c6c948eb020fd0 (patch) | |
tree | 8ccbf9ef871cd80b7073df36fa8c030e8a7655bc | |
parent | b96b5515a9dd6d4d432197fb64e07105d1d91a8b (diff) |
Since vcr_draw_bar() will assert on a negative height be
more defensive here
-rw-r--r-- | src/charts.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/charts.c b/src/charts.c index c4e51e3..30eca06 100644 --- a/src/charts.c +++ b/src/charts.c @@ -416,10 +416,14 @@ static void draw_bars(vwm_charts_t *charts, vwm_chart_t *chart, int row, float m a_t = a_fraction * inv_a_total * mult; if (a_t > 1.f) a_t = 1.f; + else if (a_t < 0.f) + a_t = 0.f; b_t = b_fraction * inv_b_total * mult; if (b_t > 1.f) b_t = 1.f; + else if (b_t < 0.f) + b_t = 0.f; /* ensure at least 1 pixel when the scaled result is a fraction less than 1, * I want to at least see 1 pixel blips for the slightest cpu utilization */ |