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
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-09-03 16:51:38 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-09-28 12:14:44 +0300
commit6f29801f1b693c5526bdb41d0c2bcf89caf5a05b (patch)
tree056d130d6a211db7e077f9315976ce281782c371 /source/blender
parentb91946780cd4fecd4dacebd1cd5b785a89773f0f (diff)
Fix Drivers Editor not hiding vertical part of cursor
When "Show Cursor" is unchecked, the Drivers Editor would still display the vertical line representing the cursor x. Probably overseen in {rB65072499c65a} (historically the vertical line could represent either the current frame of the cursor X in drawing, but this is now much more separate). There is no point in seeing part of the cursor in the Drivers Editor if this is disabled. Also correct outdated comments. ref. T91157 Maniphest Tasks: T91157 Differential Revision: https://developer.blender.org/D12391
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_graph/space_graph.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 720d69eaf4f..86e12714d62 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -237,29 +237,27 @@ static void graph_main_region_draw(const bContext *C, ARegion *region)
v2d->tot.xmax += 10.0f;
}
- if (((sipo->flag & SIPO_NODRAWCURSOR) == 0) || (sipo->mode == SIPO_MODE_DRIVERS)) {
+ if (((sipo->flag & SIPO_NODRAWCURSOR) == 0)) {
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
/* horizontal component of value-cursor (value line before the current frame line) */
- if ((sipo->flag & SIPO_NODRAWCURSOR) == 0) {
- float y = sipo->cursorVal;
+ float y = sipo->cursorVal;
- /* Draw a green line to indicate the cursor value */
- immUniformThemeColorShadeAlpha(TH_CFRAME, -10, -50);
- GPU_blend(GPU_BLEND_ALPHA);
- GPU_line_width(2.0);
+ /* Draw a line to indicate the cursor value. */
+ immUniformThemeColorShadeAlpha(TH_CFRAME, -10, -50);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_line_width(2.0);
- immBegin(GPU_PRIM_LINES, 2);
- immVertex2f(pos, v2d->cur.xmin, y);
- immVertex2f(pos, v2d->cur.xmax, y);
- immEnd();
+ immBegin(GPU_PRIM_LINES, 2);
+ immVertex2f(pos, v2d->cur.xmin, y);
+ immVertex2f(pos, v2d->cur.xmax, y);
+ immEnd();
- GPU_blend(GPU_BLEND_NONE);
- }
+ GPU_blend(GPU_BLEND_NONE);
- /* current frame or vertical component of vertical component of the cursor */
+ /* Vertical component of of the cursor. */
if (sipo->mode == SIPO_MODE_DRIVERS) {
/* cursor x-value */
float x = sipo->cursorTime;