diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-05-26 21:02:26 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-05-26 21:02:26 +0100 |
commit | 103e44d936fef961c2117febfa0140bb220ed2be (patch) | |
tree | 2c24525b500a2c353a4137e330adbf3b15b86075 /grid.c | |
parent | 2e84d1cf033adf8fe4b562b3d3caf390c15798a5 (diff) | |
parent | 097973e3d50c831c020fb0b689c3a2d66ba83b7c (diff) | |
download | rtmux-103e44d936fef961c2117febfa0140bb220ed2be.tar.gz rtmux-103e44d936fef961c2117febfa0140bb220ed2be.tar.bz2 rtmux-103e44d936fef961c2117febfa0140bb220ed2be.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'grid.c')
-rw-r--r-- | grid.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1350,3 +1350,22 @@ grid_unwrap_position(struct grid *gd, u_int *px, u_int *py, u_int wx, u_int wy) *px = wx; *py = yy; } + +/* Get length of line. */ +u_int +grid_line_length(struct grid *gd, u_int py) +{ + struct grid_cell gc; + u_int px; + + px = grid_get_line(gd, py)->cellsize; + if (px > gd->sx) + px = gd->sx; + while (px > 0) { + grid_get_cell(gd, px - 1, py, &gc); + if (gc.data.size != 1 || *gc.data.data != ' ') + break; + px--; + } + return (px); +} |