Skip to content

Commit

Permalink
make lastPingHost use all the extra pixels available to avoid bar at …
Browse files Browse the repository at this point in the history
…the bottom
  • Loading branch information
mrbesen committed Mar 19, 2024
1 parent 3621014 commit 2fb8c4b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cnping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 2fb8c4b

Please sign in to comment.