aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-02-08 10:01:22 +0000
committerThomas Adam <thomas@xteddy.org>2017-02-08 10:01:22 +0000
commita9a0039be4fafb1d6772a1c844a95eb744d922a0 (patch)
tree6dbf337ccd9c1d44837f0b28ecfacb6d50ef0682 /grid.c
parent5aaf64062929a4b43ab58a8d3072d5e126e15424 (diff)
parentcb80901d333d91fa1fc56d3eb33b520d7fb28d9d (diff)
downloadrtmux-a9a0039be4fafb1d6772a1c844a95eb744d922a0.tar.gz
rtmux-a9a0039be4fafb1d6772a1c844a95eb744d922a0.tar.bz2
rtmux-a9a0039be4fafb1d6772a1c844a95eb744d922a0.zip
Merge branch 'obsd-master'
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/grid.c b/grid.c
index f1dc130b..7fcddf61 100644
--- a/grid.c
+++ b/grid.c
@@ -292,11 +292,12 @@ grid_expand_line(struct grid *gd, u_int py, u_int sx, u_int bg)
if (sx <= gl->cellsize)
return;
- if (sx < gd->sx) {
- sx *= 2;
- if (sx > gd->sx)
- sx = gd->sx;
- }
+ if (sx < gd->sx / 4)
+ sx = gd->sx / 4;
+ else if (sx < gd->sx / 2)
+ sx = gd->sx / 2;
+ else
+ sx = gd->sx;
gl->celldata = xreallocarray(gl->celldata, sx, sizeof *gl->celldata);
for (xx = gl->cellsize; xx < sx; xx++)