mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-17 05:33:52 -04:00
grid: reflow: rename _range -> range
This commit is contained in:
parent
7c3a4b24d9
commit
315865f18c
1 changed files with 16 additions and 16 deletions
32
grid.c
32
grid.c
|
|
@ -534,32 +534,32 @@ grid_resize_and_reflow(
|
||||||
xassert(col_count >= 0 && col_count <= old_cols);
|
xassert(col_count >= 0 && col_count <= old_cols);
|
||||||
|
|
||||||
struct coord *tp = (*next_tp)->row == old_row_idx ? *next_tp : NULL;
|
struct coord *tp = (*next_tp)->row == old_row_idx ? *next_tp : NULL;
|
||||||
struct row_uri_range *_range =
|
struct row_uri_range *range =
|
||||||
old_row->extra != NULL && tll_length(old_row->extra->uri_ranges) > 0
|
old_row->extra != NULL && tll_length(old_row->extra->uri_ranges) > 0
|
||||||
? &tll_front(old_row->extra->uri_ranges)
|
? &tll_front(old_row->extra->uri_ranges)
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
if (tp != NULL)
|
if (tp != NULL)
|
||||||
col_count = max(col_count, tp->col + 1);
|
col_count = max(col_count, tp->col + 1);
|
||||||
if (_range != NULL)
|
if (range != NULL)
|
||||||
col_count = max(col_count, _range->start + 1);
|
col_count = max(col_count, range->start + 1);
|
||||||
|
|
||||||
for (int start = 0, left = col_count; left > 0;) {
|
for (int start = 0, left = col_count; left > 0;) {
|
||||||
int tp_col = -1;
|
int tp_col = -1;
|
||||||
int uri_col = -1;
|
int uri_col = -1;
|
||||||
int end;
|
int end;
|
||||||
|
|
||||||
if (tp != NULL && _range != NULL) {
|
if (tp != NULL && range != NULL) {
|
||||||
tp_col = tp->col + 1;
|
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);
|
end = min(tp_col, 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 != NULL) {
|
||||||
if (_range->start >= start)
|
if (range->start >= start)
|
||||||
uri_col = _range->start + 1;
|
uri_col = range->start + 1;
|
||||||
else
|
else
|
||||||
uri_col = _range->end + 1;
|
uri_col = range->end + 1;
|
||||||
end = uri_col;
|
end = uri_col;
|
||||||
} else
|
} else
|
||||||
end = col_count;
|
end = col_count;
|
||||||
|
|
@ -651,17 +651,17 @@ grid_resize_and_reflow(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri_break) {
|
if (uri_break) {
|
||||||
if (_range->start == start + cols - 1)
|
if (range->start == start + cols - 1)
|
||||||
reflow_uri_range_start(_range, new_row, new_col_idx);
|
reflow_uri_range_start(range, new_row, new_col_idx);
|
||||||
|
|
||||||
if (_range->end == start + cols - 1) {
|
if (range->end == start + cols - 1) {
|
||||||
reflow_uri_range_end(_range, new_row, new_col_idx);
|
reflow_uri_range_end(range, new_row, new_col_idx);
|
||||||
|
|
||||||
xassert(&tll_front(old_row->extra->uri_ranges) == _range);
|
xassert(&tll_front(old_row->extra->uri_ranges) == range);
|
||||||
grid_row_uri_range_destroy(_range);
|
grid_row_uri_range_destroy(range);
|
||||||
tll_pop_front(old_row->extra->uri_ranges);
|
tll_pop_front(old_row->extra->uri_ranges);
|
||||||
|
|
||||||
_range = tll_length(old_row->extra->uri_ranges) > 0
|
range = tll_length(old_row->extra->uri_ranges) > 0
|
||||||
? &tll_front(old_row->extra->uri_ranges)
|
? &tll_front(old_row->extra->uri_ranges)
|
||||||
: NULL;
|
: NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue