aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-05-25 17:28:11 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-02 18:13:51 +0000
commit4b7e4fb885a3d9aa7fa2152ee9439964a420ea20 (patch)
tree1916c3342521240a23fdeabdc415fb792dcfc0df
parentgrid: reflow: rename _range -> range (diff)
grid: reflow: slightly simplified logic for end-coordinate calculation
-rw-r--r--grid.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/grid.c b/grid.c
index 5a978e1c..d318c541 100644
--- a/grid.c
+++ b/grid.c
@@ -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;