grid: reflow: slightly simplified logic for end-coordinate calculation

This commit is contained in:
Daniel Eklöf 2021-05-25 19:28:11 +02:00
parent 315865f18c
commit 4b7e4fb885
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

18
grid.c
View file

@ -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;