Commit Graph

5 Commits

Author SHA1 Message Date
Petru Conduraru 89523999b3 Bonsai: fix UnboundLocalError crash in polyline angle calculation
angle_round_threshold was only assigned inside the `distance > 0`
branch of calculate_distance_and_angle, but read unconditionally
whenever should_round is True. When the mouse sample coincides with
the last placed point (distance == 0), such as the first mouse move
after placing a wall's start point on a YZ plane view, this crashed
the modal wall tool.

angle_round_threshold is a fixed cutoff unrelated to whether distance
is currently zero, so it is now assigned once before the branch.

Fixes #8597.

Generated with the assistance of an AI coding tool.
2026-07-25 13:57:51 +10:00
Andrej730 953c5fddc6 bonsai - sort imports 2026-01-26 17:13:18 +05:00
Andrej730 53a3afaded typing 2025-03-04 18:10:41 +05:00
Dion Moult 0d3245102f Fix remaining failing tool tests 2025-02-07 13:12:02 +11:00
Andrej730 0f25701967 validate_input - add basic tests 2024-12-30 17:07:53 +05:00