Skip to content

Commit 388e2ae

Browse files
committed
fix: mem box one line to small in gpu build with cpu & net shown and no gpu shown
The fix for the net box shrinking beyond the minimum size for the gpu build introduced an issue I missed. In the situation where the cpu box is shown, as well as the net and mem boxes, with no gpus shown. The mem box is one line to small and because of this the mem graphs are smaller then they should be. With a gpu shown it looks fine though which also exaggerates the issue with no gpu shown.
1 parent 6598b7d commit 388e2ae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/btop_draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,7 @@ namespace Draw {
23812381

23822382
width = round((double)Term::width * (Proc::shown ? width_p : 100) / 100);
23832383
#ifdef GPU_SUPPORT
2384-
height = floor(static_cast<double>(Term::height) * (100 - Net::height_p * Net::shown*4 / ((Gpu::shown != 0 and Cpu::shown) + 4)) / 100) - Cpu::height - Gpu::total_height;
2384+
height = floor(static_cast<double>(Term::height) * (100 - (Net::height_p - (Cpu::shown and Gpu::shown == 0)*6) * Net::shown*4 / ((Gpu::shown != 0 and Cpu::shown) + 4)) / 100) - Cpu::height - Gpu::total_height;
23852385
#else
23862386
height = floor(static_cast<double>(Term::height) * (100 - Cpu::height_p * Cpu::shown - Net::height_p * Net::shown) / 100);
23872387
#endif

0 commit comments

Comments
 (0)