kbmap: avoid division by zero when window becomes too small
This commit is contained in:
parent
0e632454e2
commit
0596178dd6
1 changed files with 2 additions and 0 deletions
|
@ -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++)
|
||||
|
|
Loading…
Reference in a new issue