Fix ui::table in case of zero rows/columns
This commit is contained in:
parent
8d41e7fcd9
commit
1878fe4b3b
1 changed files with 6 additions and 2 deletions
|
|
@ -14,7 +14,9 @@ namespace psemek::ui
|
|||
line_y_.resize(row_count() + 1);
|
||||
line_x_.resize(column_count() + 1);
|
||||
|
||||
for (std::size_t r = 0; r <= row_count(); ++r)
|
||||
if (row_count() == 0)
|
||||
line_y_[0] = box[1].center();
|
||||
else for (std::size_t r = 0; r <= row_count(); ++r)
|
||||
{
|
||||
if (r == 0)
|
||||
line_y_[r] = row_shape_[0].min - offset;
|
||||
|
|
@ -25,7 +27,9 @@ namespace psemek::ui
|
|||
line_y_[r] = std::round(line_y_[r]);
|
||||
}
|
||||
|
||||
for (std::size_t c = 0; c <= column_count(); ++c)
|
||||
if (column_count() == 0)
|
||||
line_x_[0] = box[0].center();
|
||||
else for (std::size_t c = 0; c <= column_count(); ++c)
|
||||
{
|
||||
if (c == 0)
|
||||
line_x_[c] = column_shape_[0].min - offset;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue