From 2fb8c4b228dadc26f4a7fddec686353b18ec0b88 Mon Sep 17 00:00:00 2001 From: mrbesen Date: Tue, 19 Mar 2024 17:41:57 +0100 Subject: [PATCH] make lastPingHost use all the extra pixels available to avoid bar at the bottom --- cnping.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cnping.c b/cnping.c index d5df7f7..07140a8 100644 --- a/cnping.c +++ b/cnping.c @@ -307,6 +307,12 @@ void DrawFrameHistogram( const char * pinghost, unsigned int count, unsigned int unsigned int assignedScreenHeight = screeny / count; unsigned int heightOffset = assignedScreenHeight * pingHostId; + // last pingHost gets all the extra pixels + if( pingHostId == pinghostListSize-1 ) + { + assignedScreenHeight += screeny % count; + } + if( categories <= 2 ) { goto nodata; @@ -451,7 +457,14 @@ void DrawFrame( const char * pinghost, unsigned int count, unsigned int pingHost unsigned int assignedScreenHeight = screeny / count; unsigned int heightOffset = assignedScreenHeight * pingHostId; - unsigned int heightOffsetBottom = assignedScreenHeight * (pingHostId+1); + + // last pingHost gets all the extra pixels + if( pingHostId == pinghostListSize-1 ) + { + assignedScreenHeight += screeny % count; + } + + unsigned int heightOffsetBottom = heightOffset + assignedScreenHeight; if (!GuiYscaleFactorIsConstant) {