kbmap: avoid division by zero when window becomes too small

front
cinap_lenrek 2020-12-27 23:39:28 +01:00
parent 0e632454e2
commit 0596178dd6
1 changed files with 2 additions and 0 deletions

View File

@ -103,6 +103,8 @@ geometry(void)
Rectangle r;
rows = (Dy(screen->r)-2*MARGIN+PAD)/(font->height+PAD);
if(rows < 1)
rows = 1;
r = Rect(0,0,(Dx(screen->r)-2*MARGIN), font->height);
for(i=0; i<nmap; i++)