diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-05-25 17:28:11 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-06-02 18:13:51 +0000 |
| commit | 4b7e4fb885a3d9aa7fa2152ee9439964a420ea20 (patch) | |
| tree | 1916c3342521240a23fdeabdc415fb792dcfc0df /grid.c | |
| parent | grid: reflow: rename _range -> range (diff) | |
grid: reflow: slightly simplified logic for end-coordinate calculation
Diffstat (limited to 'grid.c')
| -rw-r--r-- | grid.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -549,19 +549,17 @@ grid_resize_and_reflow( int uri_col = -1; int end; - if (tp != NULL && range != NULL) { - tp_col = tp->col + 1; + if (range != NULL) { uri_col = (range->start >= start ? range->start : range->end) + 1; - end = min(tp_col, uri_col); + + if (tp != NULL) { + tp_col = tp->col + 1; + end = min(tp_col, uri_col); + } else + end = uri_col; } else if (tp != NULL) end = tp_col = tp->col + 1; - else if (range != NULL) { - if (range->start >= start) - uri_col = range->start + 1; - else - uri_col = range->end + 1; - end = uri_col; - } else + else end = col_count; int cols = end - start; |
