diff options
author | Yevgeny Makarov <jenkm> | 2021-01-05 23:21:54 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-05 23:21:54 +0300 |
commit | 5424b4821d28c4ea42b4f195869de1e1620e6889 (patch) | |
tree | 5e73f47c4bfeed666e7b82318feea614e66feea3 /source/blender/editors | |
parent | 2ed605520959eca9c0ab3c497c85578e138936b4 (diff) |
Fix T83094: Alternate rows in the Sequencer are green (macOS)
The issue is that `UI_GetThemeColorBlendShade4fv()` creates a color
with alpha, but there is not any background underneath to blend in with.
The solution is just to draw an opaque background first, which also
halves the number of rects to draw. Note that the brighter rows get
very slightly darker after this change.
Differential Revision: https://developer.blender.org/D9947
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index d6e1a0c833b..f792f75bf96 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1880,6 +1880,10 @@ static void draw_seq_backdrop(View2D *v2d) uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + /* View backdrop. */ + immUniformThemeColorShade(TH_BACK, -25); + immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); + /* Darker overlay over the view backdrop. */ immUniformThemeColorShade(TH_BACK, -20); immRectf(pos, v2d->cur.xmin, -1.0, v2d->cur.xmax, 1.0); @@ -1887,22 +1891,18 @@ static void draw_seq_backdrop(View2D *v2d) /* Alternating horizontal stripes. */ i = max_ii(1, ((int)v2d->cur.ymin) - 1); - float col_alternating[4]; - UI_GetThemeColor4fv(TH_ROW_ALTERNATE, col_alternating); + GPU_blend(GPU_BLEND_ALPHA); + immUniformThemeColor(TH_ROW_ALTERNATE); while (i < v2d->cur.ymax) { if (i & 1) { - immUniformThemeColorBlendShade(TH_BACK, TH_ROW_ALTERNATE, col_alternating[3], -25); - } - else { - immUniformThemeColorShade(TH_BACK, -25); + immRectf(pos, v2d->cur.xmin, i, v2d->cur.xmax, i + 1); } - - immRectf(pos, v2d->cur.xmin, i, v2d->cur.xmax, i + 1); - i++; } + GPU_blend(GPU_BLEND_NONE); + /* Lines separating the horizontal bands. */ i = max_ii(1, ((int)v2d->cur.ymin) - 1); int line_len = (int)v2d->cur.ymax - i + 1; |