From 1b23a8983df3a5f409d8d22004bbcdca64071e30 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 22 Aug 2024 10:09:12 +0200 Subject: [PATCH] Fix #120950: Graph Editor FCurve line rendering The issue was that the key bounds for determining if a key can be skipped were initialized incorrectly. The order of `rctf` is [xmin, xmax, ymin, ymax] but the values were given as [x, y, x, y]. The correct order is [x, x, y, y] Pull Request: https://projects.blender.org/blender/blender/pulls/126554 --- source/blender/editors/space_graph/graph_draw.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_graph/graph_draw.cc b/source/blender/editors/space_graph/graph_draw.cc index f95f61276db..be4c19f8955 100644 --- a/source/blender/editors/space_graph/graph_draw.cc +++ b/source/blender/editors/space_graph/graph_draw.cc @@ -1049,7 +1049,7 @@ static void draw_fcurve_curve_keys( BezTriple *first_key = &fcu->bezt[index_range.first()]; rctf key_bounds = { - first_key->vec[1][0], first_key->vec[1][1], first_key->vec[1][0], first_key->vec[1][1]}; + first_key->vec[1][0], first_key->vec[1][0], first_key->vec[1][1], first_key->vec[1][1]}; /* Used when skipping keys. */ bool has_skipped_keys = false; const float min_pixel_distance = 3.0f; @@ -1069,7 +1069,7 @@ static void draw_fcurve_curve_keys( curve_vertices.append({BLI_rctf_cent_x(&key_bounds), BLI_rctf_cent_y(&key_bounds)}); has_skipped_keys = false; key_bounds = { - prevbezt->vec[1][0], prevbezt->vec[1][1], prevbezt->vec[1][0], prevbezt->vec[1][1]}; + prevbezt->vec[1][0], prevbezt->vec[1][0], prevbezt->vec[1][1], prevbezt->vec[1][1]}; expand_key_bounds(prevbezt, bezt, key_bounds); /* Calculate again based on the new prevbezt. */ pixel_distance = calculate_pixel_distance(key_bounds, pixels_per_unit);