diff options
author | Jacques Lucke <jacques@blender.org> | 2021-02-25 14:57:51 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-02-25 14:57:51 +0300 |
commit | cc3e6c4950e472163ba61e79ebf6c59c8cf099b2 (patch) | |
tree | a8684d14cdf7b3c0a63e100dd8bca2f6116fe098 /source | |
parent | 5a71c3cb56ec401ef8291da26583d43e1b142fba (diff) |
don't draw invisible column cells
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_spreadsheet/space_spreadsheet.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc index 05a7ffe3c2f..e388a20c5da 100644 --- a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc +++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc @@ -399,21 +399,23 @@ static void draw_cell_contents(const bContext *C, const SpreadsheetColumnLayout &column_layout = spreadsheet_layout.columns[column_index]; const int right_x = left_x + column_layout.width; - for (const int i : IndexRange(first_row, max_visible_rows)) { - if (i >= row_indices.size()) { - break; - } + if (right_x >= spreadsheet_layout.index_column_width && left_x <= region->winx) { + for (const int i : IndexRange(first_row, max_visible_rows)) { + if (i >= row_indices.size()) { + break; + } - if (column_layout.cell_drawer != nullptr) { - CellDrawParams params; - params.block = cells_block; - params.xmin = left_x; - params.ymin = region->winy - spreadsheet_layout.title_row_height - - (i + 1) * spreadsheet_layout.row_height - scroll_offset_y; - params.width = column_layout.width; - params.height = spreadsheet_layout.row_height; - params.index = row_indices[i]; - column_layout.cell_drawer->draw_cell(params); + if (column_layout.cell_drawer != nullptr) { + CellDrawParams params; + params.block = cells_block; + params.xmin = left_x; + params.ymin = region->winy - spreadsheet_layout.title_row_height - + (i + 1) * spreadsheet_layout.row_height - scroll_offset_y; + params.width = column_layout.width; + params.height = spreadsheet_layout.row_height; + params.index = row_indices[i]; + column_layout.cell_drawer->draw_cell(params); + } } } |