mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-09 05:33:58 -04:00
grid: reflow: slightly simplified logic for end-coordinate calculation
This commit is contained in:
parent
315865f18c
commit
4b7e4fb885
1 changed files with 8 additions and 10 deletions
18
grid.c
18
grid.c
|
|
@ -549,19 +549,17 @@ grid_resize_and_reflow(
|
||||||
int uri_col = -1;
|
int uri_col = -1;
|
||||||
int end;
|
int end;
|
||||||
|
|
||||||
if (tp != NULL && range != NULL) {
|
if (range != NULL) {
|
||||||
tp_col = tp->col + 1;
|
|
||||||
uri_col = (range->start >= start ? range->start : range->end) + 1;
|
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)
|
} else if (tp != NULL)
|
||||||
end = tp_col = tp->col + 1;
|
end = tp_col = tp->col + 1;
|
||||||
else if (range != NULL) {
|
else
|
||||||
if (range->start >= start)
|
|
||||||
uri_col = range->start + 1;
|
|
||||||
else
|
|
||||||
uri_col = range->end + 1;
|
|
||||||
end = uri_col;
|
|
||||||
} else
|
|
||||||
end = col_count;
|
end = col_count;
|
||||||
|
|
||||||
int cols = end - start;
|
int cols = end - start;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue