[Bf-blender-cvs] [6f29801f1b6] master: Fix Drivers Editor not hiding vertical part of cursor

Philipp Oeser noreply at git.blender.org
Tue Sep 28 11:15:31 CEST 2021


Commit: 6f29801f1b693c5526bdb41d0c2bcf89caf5a05b
Author: Philipp Oeser
Date:   Fri Sep 3 15:51:38 2021 +0200
Branches: master
https://developer.blender.org/rB6f29801f1b693c5526bdb41d0c2bcf89caf5a05b

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

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

M	source/blender/editors/space_graph/space_graph.c

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

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;



More information about the Bf-blender-cvs mailing list