Commit: 288bcb2593f52c47225da9ea8efe13d288d35892
Author: Joshua Leung
Date:   Fri Jul 6 15:38:25 2018 +1200
Branches: blender2.8
https://developer.blender.org/rB288bcb2593f52c47225da9ea8efe13d288d35892

Further tweaks to drawing of non-selected graph editor keyframes

The previous commit only solves the problem when using the default
theme using factory settings. For previously saved themes, there could
still be problems, as the alpha values were still 0.

This commit improves the logic here so that while keyframe points on
unselected F-Curves will still get faded out (to not stick out too much
from the curves they live on), but the effect will not be as pronounced
(i.e. the points will stay visible all the time).

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

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

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

diff --git a/source/blender/editors/space_graph/graph_draw.c 
b/source/blender/editors/space_graph/graph_draw.c
index b08ff8dcfa1..4e9f8cd3733 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -148,21 +148,27 @@ static void 
draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d)
 /* helper func - set color to draw F-Curve data with */
 static void set_fcurve_vertex_color(FCurve *fcu, bool sel)
 {
-       /* Fade the 'intensity' of the vertices based on the selection of the 
curves too */
-       int alphaOffset = (int)((fcurve_display_alpha(fcu) - 1.0f) * 255);
-
        float color[4];
+       float diff;
 
        /* Set color of curve vertex based on state of curve (i.e. 'Edit' Mode) 
*/
        if ((fcu->flag & FCURVE_PROTECTED) == 0) {
                /* Curve's points ARE BEING edited */
-               UI_GetThemeColorShadeAlpha4fv(sel ? TH_VERTEX_SELECT : 
TH_VERTEX, 0, alphaOffset, color);
+               UI_GetThemeColor3fv(sel ? TH_VERTEX_SELECT : TH_VERTEX, color);
        }
        else {
                /* Curve's points CANNOT BE edited */
-               UI_GetThemeColorShadeAlpha4fv(sel ? TH_TEXT_HI : TH_TEXT, 0, 
alphaOffset, color);
+               UI_GetThemeColor3fv(sel ? TH_TEXT_HI : TH_TEXT, color);
        }
 
+       /* Fade the 'intensity' of the vertices based on the selection of the 
curves too
+        * - Only fade by 50% the amount the curves were faded by, so that the 
points
+        *   still stand out for easier selection
+        */
+       diff = 1.0f - fcurve_display_alpha(fcu);
+       color[3] = 1.0f - (diff * 0.5f);
+       CLAMP(color[3], 0.2f, 1.0f);
+
        immUniformColor4fv(color);
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to