Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-05-04 21:20:15 +0300
committerJulian Eisel <julian@blender.org>2021-05-04 21:31:33 +0300
commitd28c46183d8890114784692d0ebee27d4cc2cff9 (patch)
tree105d3989c31499fb7aafa782a243078c44e5014b /source
parentb3ba41ecd1e1ed1cbb28b9fe90efb3c4f4e596c8 (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')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_draw.cc18
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,