mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 07:28:38 +00:00
Use Blender's angle snap setting in tool/polyline.py
Replace hardcoded 5-degree angle snapping with Blender's snap_angle_increment setting in calculate_distance_and_angle(). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Bruno Perdigão
parent
348e48b49c
commit
cd95f46db5
@@ -191,7 +191,8 @@ class Polyline(bonsai.core.tool.Polyline):
|
|||||||
orientation_angle = 0
|
orientation_angle = 0
|
||||||
if input_ui:
|
if input_ui:
|
||||||
if should_round:
|
if should_round:
|
||||||
angle = 5 * round(angle / 5) if distance < angle_round_threshold else angle
|
angle_snap = tool.Snap.get_angle_snap_value(context)
|
||||||
|
angle = angle_snap * round(angle / angle_snap) if distance < angle_round_threshold else angle
|
||||||
factor = tool.Snap.get_increment_snap_value(context)
|
factor = tool.Snap.get_increment_snap_value(context)
|
||||||
distance = factor * round(distance / factor)
|
distance = factor * round(distance / factor)
|
||||||
input_ui.set_value("X", mouse_vector.x)
|
input_ui.set_value("X", mouse_vector.x)
|
||||||
|
|||||||
Reference in New Issue
Block a user