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:
authorJoshua Leung <aligorith@gmail.com>2018-07-06 06:38:25 +0300
committerJoshua Leung <aligorith@gmail.com>2018-07-06 06:38:25 +0300
commit288bcb2593f52c47225da9ea8efe13d288d35892 (patch)
tree4698e796b562ed4fd7bdaabcc0d050eb7cec4a31 /source/blender/editors/space_graph
parenta71c2deac5d1a80d802fb646474da2256d73d79f (diff)
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).
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c16
1 files changed, 11 insertions, 5 deletions
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);
}