Skip to content

Commit d5acb6c

Browse files
committed
fix: mem box sizing after min net box size fix
1 parent 6598b7d commit d5acb6c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/btop_draw.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,9 +2381,11 @@ 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+
const int net_height_offset = 6;
2385+
height = floor(static_cast<double>(Term::height) * (100 - (Net::height_p - (Cpu::shown and Gpu::shown == 0) * net_height_offset) * Net::shown*4 / ((Gpu::shown != 0 and Cpu::shown) + 4)) / 100) - Cpu::height - Gpu::total_height;
23852386
#else
2386-
height = floor(static_cast<double>(Term::height) * (100 - Cpu::height_p * Cpu::shown - Net::height_p * Net::shown) / 100);
2387+
const int net_height_offset = 4;
2388+
height = floor(static_cast<double>(Term::height) * (100 - Cpu::height_p * Cpu::shown - (Net::height_p - net_height_offset) * Net::shown) / 100);
23872389
#endif
23882390
x = (proc_left and Proc::shown) ? Term::width - width + 1: 1;
23892391
if (mem_below_net and Net::shown)

0 commit comments

Comments
 (0)