From 8d9754bfaaa7f0a404cc1a37f59feb5bb22c8d36 Mon Sep 17 00:00:00 2001 From: Janne Nylander Date: Mon, 1 Sep 2025 13:37:12 +0200 Subject: [PATCH] Fix: Grease Pencil: Pen tool moving incorrect handle when extruding from curve start Previously, if a user extruded a curve with the Pen tool and held down the `Ctrl` modifier key, the right handle would always be moved independently. This should not happen when extruding a curve from the beginning. This pull request adds a check that will determine if the left handle is currently selected when extruding a curve. This is the case, when extruding a curve from the beginning. Then, the left handle will be moved independently, instead of the right handle. Pull Request: https://projects.blender.org/blender/blender/pulls/145235 --- .../grease_pencil/intern/grease_pencil_pen.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_pen.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_pen.cc index 41f4ab723e9..5cb62e3711b 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_pen.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_pen.cc @@ -312,16 +312,23 @@ struct PenToolOperation { return; } + const bool is_left = !right_selected[point_i]; if (this->move_handle) { - const float2 pos_right = this->layer_to_screen(layer_to_object, handles_right[point_i]); - handles_right[point_i] = this->screen_to_layer( - layer_to_world, pos_right + offset, depth_point); + if (is_left) { + const float2 pos_left = this->layer_to_screen(layer_to_object, handles_left[point_i]); + handles_left[point_i] = this->screen_to_layer( + layer_to_world, pos_left + offset, depth_point); + } + else { + const float2 pos_right = this->layer_to_screen(layer_to_object, handles_right[point_i]); + handles_right[point_i] = this->screen_to_layer( + layer_to_world, pos_right + offset, depth_point); + } handle_types_left[point_i] = BEZIER_HANDLE_FREE; handle_types_right[point_i] = BEZIER_HANDLE_FREE; return; } - const bool is_left = !right_selected[point_i]; const float2 center_point = this->layer_to_screen(layer_to_object, depth_point); offset = this->mouse_co - this->center_of_mass_co;