From ec18a8799e85b2b76393eb00b543d1933c155004 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 9 Mar 2023 09:48:43 +0100 Subject: [PATCH 1/7] fcurve drawing changes --- .../blender/editors/space_graph/graph_draw.c | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 23f3cb068ab..9c7d2ddf2d9 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -154,7 +154,7 @@ static void set_fcurve_vertex_color(FCurve *fcu, bool sel) } else { /* Curve's points CANNOT BE edited */ - UI_GetThemeColor3fv(sel ? TH_TEXT_HI : TH_TEXT, color); + UI_GetThemeColor3fv(TH_VERTEX, color); } /* Fade the 'intensity' of the vertices based on the selection of the curves too @@ -175,7 +175,13 @@ static void draw_fcurve_selected_keyframe_vertices( set_fcurve_vertex_color(fcu, sel); - immBeginAtMost(GPU_PRIM_POINTS, fcu->totvert); + if (edit) { + immBeginAtMost(GPU_PRIM_POINTS, fcu->totvert); + } + else { + immBeginAtMost(GPU_PRIM_POINTS, fcu->totvert); + /* immBegin(GPU_PRIM_LINES, fcu->totvert * 2); */ + } BezTriple *bezt = fcu->bezt; for (int i = 0; i < fcu->totvert; i++, bezt++) { @@ -194,9 +200,11 @@ static void draw_fcurve_selected_keyframe_vertices( } } else { - /* no check for selection here, as curve is not editable... */ - /* XXX perhaps we don't want to even draw points? maybe add an option for that later */ + const float line_length = 2 * U.dpi_fac; immVertex2fv(pos, bezt->vec[1]); + + /* immVertex2f(pos, bezt->vec[1][0] + line_length, bezt->vec[1][1] - line_length); + immVertex2f(pos, bezt->vec[1][0] - line_length, bezt->vec[1][1] + line_length); */ } } } @@ -1022,7 +1030,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert))) { /* set color/drawing style for curve itself */ /* draw active F-Curve thicker than the rest to make it stand out */ - if (fcu->flag & FCURVE_ACTIVE) { + if (fcu->flag & FCURVE_ACTIVE && !BKE_fcurve_is_protected(fcu)) { GPU_line_width(2.5); } else { @@ -1046,8 +1054,8 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn immBindBuiltinProgram(GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR); immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC); immUniform1i("colors_len", 0); /* Simple dashes. */ - immUniform1f("dash_width", 4.0f); - immUniform1f("udash_factor", 0.5f); + immUniform1f("dash_width", 16.0f * U.dpi_fac); + immUniform1f("udash_factor", 0.4f * U.dpi_fac); } else { immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); -- 2.30.2 From 5775ae95a75ccb7ddb1cbf613c5d11634fa0acf5 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 23 Mar 2023 12:32:19 +0100 Subject: [PATCH 2/7] fix change to U.scale_factor --- source/blender/editors/space_graph/graph_draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index da7d9988473..a03d2762d06 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -200,7 +200,7 @@ static void draw_fcurve_selected_keyframe_vertices( } } else { - const float line_length = 2 * U.dpi_fac; + const float line_length = 2 * U.scale_factor; immVertex2fv(pos, bezt->vec[1]); /* immVertex2f(pos, bezt->vec[1][0] + line_length, bezt->vec[1][1] - line_length); @@ -1054,8 +1054,8 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn immUniform2f( "viewport_size", viewport_size[2] / UI_SCALE_FAC, viewport_size[3] / UI_SCALE_FAC); immUniform1i("colors_len", 0); /* Simple dashes. */ - immUniform1f("dash_width", 16.0f * U.dpi_fac); - immUniform1f("udash_factor", 0.4f * U.dpi_fac); + immUniform1f("dash_width", 16.0f * U.scale_factor); + immUniform1f("udash_factor", 0.4f * U.scale_factor); } else { immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); -- 2.30.2 From 01eb147c0dcbf0c16f9e72dbd5f2ad09fd3353d4 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 23 Mar 2023 17:25:35 +0100 Subject: [PATCH 3/7] draw x for keys on locked curves --- .../blender/editors/space_graph/graph_draw.c | 144 +++++++++++------- 1 file changed, 85 insertions(+), 59 deletions(-) diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index a03d2762d06..ef9dd3dea69 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -168,20 +168,36 @@ static void set_fcurve_vertex_color(FCurve *fcu, bool sel) immUniformColor4fv(color); } -static void draw_fcurve_selected_keyframe_vertices( - FCurve *fcu, View2D *v2d, bool edit, bool sel, uint pos) +/* Draw a cross at the given position. Shader must already be bound. + * NOTE: the caller MUST HAVE GL_LINE_SMOOTH & GL_BLEND ENABLED, otherwise the controls don't + * have a consistent appearance (due to off-pixel alignments). + */ +static void draw_x(float position[2], float scale[2], uint attr_id) +{ + GPU_matrix_push(); + GPU_matrix_translate_2fv(position); + GPU_matrix_scale_2f(1.0f / scale[0], 1.0f / scale[1]); + + /* Draw X shape. */ + const float line_length = 0.7f; + immBegin(GPU_PRIM_LINES, 4); + immVertex2f(attr_id, -line_length, -line_length); + immVertex2f(attr_id, +line_length, +line_length); + + immVertex2f(attr_id, -line_length, +line_length); + immVertex2f(attr_id, +line_length, -line_length); + immEnd(); + + GPU_matrix_pop(); +} + +static void draw_fcurve_selected_keyframe_vertices(FCurve *fcu, View2D *v2d, bool sel, uint pos) { const float fac = 0.05f * BLI_rctf_size_x(&v2d->cur); set_fcurve_vertex_color(fcu, sel); - if (edit) { - immBeginAtMost(GPU_PRIM_POINTS, fcu->totvert); - } - else { - immBeginAtMost(GPU_PRIM_POINTS, fcu->totvert); - /* immBegin(GPU_PRIM_LINES, fcu->totvert * 2); */ - } + immBeginAtMost(GPU_PRIM_POINTS, fcu->totvert); BezTriple *bezt = fcu->bezt; for (int i = 0; i < fcu->totvert; i++, bezt++) { @@ -190,21 +206,12 @@ static void draw_fcurve_selected_keyframe_vertices( * don't pop in/out due to slight twitches of view size. */ if (IN_RANGE(bezt->vec[1][0], (v2d->cur.xmin - fac), (v2d->cur.xmax + fac))) { - if (edit) { - /* 'Keyframe' vertex only, as handle lines and handles have already been drawn - * - only draw those with correct selection state for the current drawing color - * - - */ - if ((bezt->f2 & SELECT) == sel) { - immVertex2fv(pos, bezt->vec[1]); - } - } - else { - const float line_length = 2 * U.scale_factor; + /* 'Keyframe' vertex only, as handle lines and handles have already been drawn + * - only draw those with correct selection state for the current drawing color + * - + */ + if ((bezt->f2 & SELECT) == sel) { immVertex2fv(pos, bezt->vec[1]); - - /* immVertex2f(pos, bezt->vec[1][0] + line_length, bezt->vec[1][1] - line_length); - immVertex2f(pos, bezt->vec[1][0] - line_length, bezt->vec[1][1] + line_length); */ } } } @@ -212,6 +219,31 @@ static void draw_fcurve_selected_keyframe_vertices( immEnd(); } +static void draw_locked_keyframe_vertices(FCurve *fcu, View2D *v2d, uint attr_id) +{ + const float correction_factor = 0.05f * BLI_rctf_size_x(&v2d->cur); + + /* get view settings */ + const float vertex_size = UI_GetThemeValuef(TH_VERTEX_SIZE); + float scale[2]; + UI_view2d_scale_get(v2d, &scale[0], &scale[1]); + scale[0] /= vertex_size; + scale[1] /= vertex_size; + + set_fcurve_vertex_color(fcu, false); + + for (int i = 0; i < fcu->totvert; i++) { + BezTriple *bezt = &fcu->bezt[i]; + if (!IN_RANGE(bezt->vec[1][0], + (v2d->cur.xmin - correction_factor), + (v2d->cur.xmax + correction_factor))) { + continue; + } + float position[2] = {bezt->vec[1][0], bezt->vec[1][1]}; + draw_x(position, scale, attr_id); + } +} + /** * Draw the extra indicator for the active point. */ @@ -241,15 +273,32 @@ static void draw_fcurve_active_vertex(const FCurve *fcu, const View2D *v2d, cons /* helper func - draw keyframe vertices only for an F-Curve */ static void draw_fcurve_keyframe_vertices(FCurve *fcu, View2D *v2d, bool edit, uint pos) { - immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); + if (edit) { + immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); - immUniform1f("size", UI_GetThemeValuef(TH_VERTEX_SIZE) * UI_SCALE_FAC); + immUniform1f("size", UI_GetThemeValuef(TH_VERTEX_SIZE) * UI_SCALE_FAC); - draw_fcurve_selected_keyframe_vertices(fcu, v2d, edit, false, pos); - draw_fcurve_selected_keyframe_vertices(fcu, v2d, edit, true, pos); - draw_fcurve_active_vertex(fcu, v2d, pos); + draw_fcurve_selected_keyframe_vertices(fcu, v2d, false, pos); + draw_fcurve_selected_keyframe_vertices(fcu, v2d, true, pos); + draw_fcurve_active_vertex(fcu, v2d, pos); - immUnbindProgram(); + immUnbindProgram(); + } + else { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { + GPU_line_smooth(true); + } + GPU_blend(GPU_BLEND_ALPHA); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); + + draw_locked_keyframe_vertices(fcu, v2d, pos); + + immUnbindProgram(); + GPU_blend(GPU_BLEND_NONE); + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { + GPU_line_smooth(false); + } + } } /* helper func - draw handle vertices only for an F-Curve (if it is not protected) */ @@ -497,40 +546,17 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu) /* Samples ---------------- */ -/* helper func - draw sample-range marker for an F-Curve as a cross - * NOTE: the caller MUST HAVE GL_LINE_SMOOTH & GL_BLEND ENABLED, otherwise, the controls don't - * have a consistent appearance (due to off-pixel alignments)... - */ -static void draw_fcurve_sample_control( - float x, float y, float xscale, float yscale, float hsize, uint pos) -{ - /* adjust view transform before starting */ - GPU_matrix_push(); - GPU_matrix_translate_2f(x, y); - GPU_matrix_scale_2f(1.0f / xscale * hsize, 1.0f / yscale * hsize); - - /* draw X shape */ - immBegin(GPU_PRIM_LINES, 4); - immVertex2f(pos, -0.7f, -0.7f); - immVertex2f(pos, +0.7f, +0.7f); - - immVertex2f(pos, -0.7f, +0.7f); - immVertex2f(pos, +0.7f, -0.7f); - immEnd(); - - /* restore view transform */ - GPU_matrix_pop(); -} - /* helper func - draw keyframe vertices only for an F-Curve */ static void draw_fcurve_samples(ARegion *region, FCurve *fcu) { FPoint *first, *last; - float hsize, xscale, yscale; + float scale[2]; /* get view settings */ - hsize = UI_GetThemeValuef(TH_VERTEX_SIZE); - UI_view2d_scale_get(®ion->v2d, &xscale, &yscale); + const float hsize = UI_GetThemeValuef(TH_VERTEX_SIZE); + UI_view2d_scale_get(®ion->v2d, &scale[0], &scale[1]); + scale[0] /= hsize; + scale[1] /= hsize; /* get verts */ first = fcu->fpt; @@ -549,8 +575,8 @@ static void draw_fcurve_samples(ARegion *region, FCurve *fcu) immUniformThemeColor((fcu->flag & FCURVE_SELECTED) ? TH_TEXT_HI : TH_TEXT); - draw_fcurve_sample_control(first->vec[0], first->vec[1], xscale, yscale, hsize, pos); - draw_fcurve_sample_control(last->vec[0], last->vec[1], xscale, yscale, hsize, pos); + draw_x(first->vec, scale, pos); + draw_x(last->vec, scale, pos); immUnbindProgram(); -- 2.30.2 From eb1b55b376e609b44ea93e355ebd52b597bc19f1 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Fri, 2 Jun 2023 12:04:00 +0200 Subject: [PATCH 4/7] change dash widthjand refactor function name --- source/blender/editors/space_graph/graph_draw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index a516d13cffe..acfc0e5d392 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -173,7 +173,7 @@ static void set_fcurve_vertex_color(FCurve *fcu, bool sel) * NOTE: the caller MUST HAVE GL_LINE_SMOOTH & GL_BLEND ENABLED, otherwise the controls don't * have a consistent appearance (due to off-pixel alignments). */ -static void draw_x(float position[2], float scale[2], uint attr_id) +static void draw_cross(float position[2], float scale[2], uint attr_id) { GPU_matrix_push(); GPU_matrix_translate_2fv(position); @@ -241,7 +241,7 @@ static void draw_locked_keyframe_vertices(FCurve *fcu, View2D *v2d, uint attr_id continue; } float position[2] = {bezt->vec[1][0], bezt->vec[1][1]}; - draw_x(position, scale, attr_id); + draw_cross(position, scale, attr_id); } } @@ -580,8 +580,8 @@ static void draw_fcurve_samples(ARegion *region, FCurve *fcu) immUniformThemeColor((fcu->flag & FCURVE_SELECTED) ? TH_TEXT_HI : TH_TEXT); - draw_x(first->vec, scale, pos); - draw_x(last->vec, scale, pos); + draw_cross(first->vec, scale, pos); + draw_cross(last->vec, scale, pos); immUnbindProgram(); @@ -1090,7 +1090,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn "viewport_size", viewport_size[2] / UI_SCALE_FAC, viewport_size[3] / UI_SCALE_FAC); immUniform1i("colors_len", 0); /* Simple dashes. */ immUniform1f("dash_width", 16.0f * U.scale_factor); - immUniform1f("udash_factor", 0.4f * U.scale_factor); + immUniform1f("udash_factor", 0.2f * U.scale_factor); } else { immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); -- 2.30.2 From 190b9c3de732bead27b772d2ff7e2db47955bd8e Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Fri, 2 Jun 2023 12:13:14 +0200 Subject: [PATCH 5/7] change dash width to 0.35 --- source/blender/editors/space_graph/graph_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index acfc0e5d392..5ac1d90d195 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1090,7 +1090,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn "viewport_size", viewport_size[2] / UI_SCALE_FAC, viewport_size[3] / UI_SCALE_FAC); immUniform1i("colors_len", 0); /* Simple dashes. */ immUniform1f("dash_width", 16.0f * U.scale_factor); - immUniform1f("udash_factor", 0.2f * U.scale_factor); + immUniform1f("udash_factor", 0.35f * U.scale_factor); } else { immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); -- 2.30.2 From 83f8a0a63fc114d8bc65f3511d1ade3ac548b41b Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Fri, 7 Jul 2023 14:35:36 +0200 Subject: [PATCH 6/7] fix euler rotations unit scale --- .../blender/editors/space_graph/graph_draw.c | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index e3aaf05975a..a56ac8075ff 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -220,7 +220,10 @@ static void draw_fcurve_selected_keyframe_vertices(FCurve *fcu, View2D *v2d, boo immEnd(); } -static void draw_locked_keyframe_vertices(FCurve *fcu, View2D *v2d, uint attr_id) +static void draw_locked_keyframe_vertices(FCurve *fcu, + View2D *v2d, + const uint attr_id, + const float unit_scale) { const float correction_factor = 0.05f * BLI_rctf_size_x(&v2d->cur); @@ -229,7 +232,9 @@ static void draw_locked_keyframe_vertices(FCurve *fcu, View2D *v2d, uint attr_id float scale[2]; UI_view2d_scale_get(v2d, &scale[0], &scale[1]); scale[0] /= vertex_size; - scale[1] /= vertex_size; + /* Dividing by the unit scale is needed to display euler correctly (internally they are radians + * but displayed as degrees) and all curves when normalization is turned on. */ + scale[1] /= vertex_size / unit_scale; set_fcurve_vertex_color(fcu, false); @@ -272,7 +277,8 @@ static void draw_fcurve_active_vertex(const FCurve *fcu, const View2D *v2d, cons } /* helper func - draw keyframe vertices only for an F-Curve */ -static void draw_fcurve_keyframe_vertices(FCurve *fcu, View2D *v2d, bool edit, uint pos) +static void draw_fcurve_keyframe_vertices( + FCurve *fcu, View2D *v2d, bool edit, const uint pos, const float unit_scale) { if (edit) { immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); @@ -292,7 +298,7 @@ static void draw_fcurve_keyframe_vertices(FCurve *fcu, View2D *v2d, bool edit, u GPU_blend(GPU_BLEND_ALPHA); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); - draw_locked_keyframe_vertices(fcu, v2d, pos); + draw_locked_keyframe_vertices(fcu, v2d, pos, unit_scale); immUnbindProgram(); GPU_blend(GPU_BLEND_NONE); @@ -402,10 +408,8 @@ static void draw_fcurve_handle_vertices(FCurve *fcu, View2D *v2d, bool sel_handl immUnbindProgram(); } -static void draw_fcurve_vertices(ARegion *region, - FCurve *fcu, - bool do_handles, - bool sel_handle_only) +static void draw_fcurve_vertices( + ARegion *region, FCurve *fcu, bool do_handles, bool sel_handle_only, const float unit_scale) { View2D *v2d = ®ion->v2d; @@ -428,7 +432,7 @@ static void draw_fcurve_vertices(ARegion *region, } /* draw keyframes over the handles */ - draw_fcurve_keyframe_vertices(fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), pos); + draw_fcurve_keyframe_vertices(fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), pos, unit_scale); GPU_program_point_size(false); GPU_blend(GPU_BLEND_NONE); @@ -552,7 +556,7 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu) /* Samples ---------------- */ /* helper func - draw keyframe vertices only for an F-Curve */ -static void draw_fcurve_samples(ARegion *region, FCurve *fcu) +static void draw_fcurve_samples(ARegion *region, FCurve *fcu, const float unit_scale) { FPoint *first, *last; float scale[2]; @@ -560,8 +564,9 @@ static void draw_fcurve_samples(ARegion *region, FCurve *fcu) /* get view settings */ const float hsize = UI_GetThemeValuef(TH_VERTEX_SIZE); UI_view2d_scale_get(®ion->v2d, &scale[0], &scale[1]); + scale[0] /= hsize; - scale[1] /= hsize; + scale[1] /= hsize / unit_scale; /* get verts */ first = fcu->fpt; @@ -1190,7 +1195,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn else if (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert)) { short mapping_flag = ANIM_get_normalization_flags(ac); float offset; - float unit_scale = ANIM_unit_mapping_get_factor( + const float unit_scale = ANIM_unit_mapping_get_factor( ac->scene, ale->id, fcu, mapping_flag, &offset); /* apply unit-scaling to all values via OpenGL */ @@ -1210,11 +1215,12 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn draw_fcurve_handles(sipo, fcu); } - draw_fcurve_vertices(region, fcu, do_handles, (sipo->flag & SIPO_SELVHANDLESONLY)); + draw_fcurve_vertices( + region, fcu, do_handles, (sipo->flag & SIPO_SELVHANDLESONLY), unit_scale); } else { /* samples: only draw two indicators at either end as indicators */ - draw_fcurve_samples(region, fcu); + draw_fcurve_samples(region, fcu, unit_scale); } GPU_matrix_pop(); -- 2.30.2 From 12d7433b4d18adc65aa4e7b685618d6bcf014def Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Fri, 7 Jul 2023 15:02:16 +0200 Subject: [PATCH 7/7] change scale[1] to remove a division --- source/blender/editors/space_graph/graph_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index a56ac8075ff..00405a05b75 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -234,7 +234,7 @@ static void draw_locked_keyframe_vertices(FCurve *fcu, scale[0] /= vertex_size; /* Dividing by the unit scale is needed to display euler correctly (internally they are radians * but displayed as degrees) and all curves when normalization is turned on. */ - scale[1] /= vertex_size / unit_scale; + scale[1] = scale[1] / vertex_size * unit_scale; set_fcurve_vertex_color(fcu, false); -- 2.30.2