diff --git a/libs/ui/source/table.cpp b/libs/ui/source/table.cpp index 4299f73b..ab04c453 100644 --- a/libs/ui/source/table.cpp +++ b/libs/ui/source/table.cpp @@ -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;