[Bf-blender-cvs] [cc3e6c4950e] temp-spreadsheet-editor: don't draw invisible column cells

Jacques Lucke noreply at git.blender.org
Thu Feb 25 13:33:58 CET 2021


Commit: cc3e6c4950e472163ba61e79ebf6c59c8cf099b2
Author: Jacques Lucke
Date:   Thu Feb 25 12:57:51 2021 +0100
Branches: temp-spreadsheet-editor
https://developer.blender.org/rBcc3e6c4950e472163ba61e79ebf6c59c8cf099b2

don't draw invisible column cells

===================================================================

M	source/blender/editors/space_spreadsheet/space_spreadsheet.cc

===================================================================

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);
+        }
       }
     }



More information about the Bf-blender-cvs mailing list