diff options
author | Julian Eisel <julian@blender.org> | 2021-05-04 21:20:15 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-05-04 21:20:15 +0300 |
commit | 5ea113a555bebffda14f27b8133dc23f54d9b0c6 (patch) | |
tree | 516b247176de0c1b7c3cddd02217297bb5c235c3 /source/blender/editors/space_spreadsheet/spreadsheet_draw.cc | |
parent | 87ee8ddfe36a0e875bf93401cf039447fff664fe (diff) |
Fix missing header & footer toggle chevrons in Spreadsheet
The little chevron tab to open a hidden region wouldn't show up in the
Spreadsheet editor. Cause was an incorrect GPU-scissor usage:
While drawing regions, the scissors should be kept enabled, just the
scissor rectangle should be updated - and afterwards reset to what it
was before.
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_draw.cc')
-rw-r--r-- | source/blender/editors/space_spreadsheet/spreadsheet_draw.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_draw.cc b/source/blender/editors/space_spreadsheet/spreadsheet_draw.cc index d6379c740e8..b911c80fa63 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_draw.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_draw.cc @@ -142,7 +142,9 @@ static void draw_left_column_content(const int scroll_offset_y, ARegion *region, const SpreadsheetDrawer &drawer) { - GPU_scissor_test(true); + int old_scissor[4]; + GPU_scissor_get(old_scissor); + GPU_scissor(0, 0, drawer.left_column_width, region->winy - drawer.top_row_height); uiBlock *left_column_block = UI_block_begin(C, region, __func__, UI_EMBOSS_NONE); @@ -165,7 +167,7 @@ static void draw_left_column_content(const int scroll_offset_y, UI_block_end(C, left_column_block); UI_block_draw(C, left_column_block); - GPU_scissor_test(false); + GPU_scissor(UNPACK4(old_scissor)); } static void draw_top_row_content(const bContext *C, @@ -173,7 +175,9 @@ static void draw_top_row_content(const bContext *C, const SpreadsheetDrawer &drawer, const int scroll_offset_x) { - GPU_scissor_test(true); + int old_scissor[4]; + GPU_scissor_get(old_scissor); + GPU_scissor(drawer.left_column_width + 1, region->winy - drawer.top_row_height, region->winx - drawer.left_column_width, @@ -200,7 +204,7 @@ static void draw_top_row_content(const bContext *C, UI_block_end(C, first_row_block); UI_block_draw(C, first_row_block); - GPU_scissor_test(false); + GPU_scissor(UNPACK4(old_scissor)); } static void draw_cell_contents(const bContext *C, @@ -209,7 +213,9 @@ static void draw_cell_contents(const bContext *C, const int scroll_offset_x, const int scroll_offset_y) { - GPU_scissor_test(true); + int old_scissor[4]; + GPU_scissor_get(old_scissor); + GPU_scissor(drawer.left_column_width + 1, 0, region->winx - drawer.left_column_width, @@ -248,7 +254,7 @@ static void draw_cell_contents(const bContext *C, UI_block_end(C, cells_block); UI_block_draw(C, cells_block); - GPU_scissor_test(false); + GPU_scissor(UNPACK4(old_scissor)); } static void update_view2d_tot_rect(const SpreadsheetDrawer &drawer, |