From 175099d778e9bc1976d1ee268718f0ea2e753246 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sun, 29 Dec 2024 23:44:39 -0800 Subject: [PATCH] make maxval work better near p8 precision limits --- vacuum_gambit.p8 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vacuum_gambit.p8 b/vacuum_gambit.p8 index 49275bc..383f6b1 100644 --- a/vacuum_gambit.p8 +++ b/vacuum_gambit.p8 @@ -423,9 +423,13 @@ end function vertmeter(x0,y0,x1,y1,val,maxval,cols) if ((val <= 0) or (maxval <= 0)) return + if val < 0x0.001 or maxval < 0x0.001 then + val *= 16 + maxval *= 16 + end val=min(val, maxval) local h = y1-y0 - local px = val/maxval * h \ 1 + local px = val*h/maxval \ 1 local ncols = #cols local firstcol = ((h-px)*ncols\h)+1 local lastbottom = y0+(h*firstcol\ncols)