Fix #147402: Pen Tool doesn't return to the Aligned type after LeftCtrl

This makes it so that the Pen Tool will return the handle type back
to `Align` after letting go of `LeftCtrl`

This effects Grease Pencil and Curves objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/147943
This commit is contained in:
Casey Bianco-Davis
2025-10-14 10:50:21 +02:00
committed by Falk David
parent c93d94d2e1
commit 2bb7a9f05d
2 changed files with 12 additions and 1 deletions

View File

@@ -479,7 +479,9 @@ static bool move_handles_in_curve(const PenToolOperation &ptd,
offset = snap_8_angles(offset);
}
if (ptd.point_added) {
/* Set both handles to be `Aligned` if this point is newly added or is
* no longer control freely. */
if (ptd.point_added || ptd.handle_moved) {
handle_types_left[point_i] = BEZIER_HANDLE_ALIGN;
handle_types_right[point_i] = BEZIER_HANDLE_ALIGN;
}
@@ -1181,6 +1183,8 @@ wmOperatorStatus PenToolOperation::invoke(bContext *C, wmOperator *op, const wmE
this->move_entire = false;
this->snap_angle = false;
this->handle_moved = false;
if (!(ELEM(event->type, LEFTMOUSE) && ELEM(event->val, KM_PRESS, KM_DBL_CLICK))) {
return OPERATOR_RUNNING_MODAL;
}
@@ -1223,6 +1227,11 @@ wmOperatorStatus PenToolOperation::modal(bContext *C, wmOperator *op, const wmEv
}
else if (event->val == int(PenModal::MoveHandle)) {
this->move_handle = !this->move_handle;
/* Record if handle has every been moved. */
if (this->move_handle) {
this->handle_moved = true;
}
}
}

View File

@@ -91,6 +91,8 @@ class PenToolOperation {
bool point_added;
bool point_removed;
/* Used to go back to `aligned` after `move_handle` becomes `false` */
bool handle_moved;
float4x4 projection;
float2 mouse_co;