fix(ipc): rotate_component uses absolute angle (matches schema) (#159)

* Fix: IPC rotate_component now uses absolute angle as documented

The IPC rotate handler was adding the angle to the current rotation
(relative), but the schema documents it as absolute. This caused
unexpected behavior where setting angle=0 had no effect on a component
already at 180°. Now correctly sets the rotation to the exact angle
specified, matching the SWIG backend behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs(changelog): add unreleased entry for rotate_component absolute-angle fix

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Gavin Colonese
2026-05-18 23:00:22 -04:00
committed by GitHub
parent c538714743
commit 457e4e30ad
3 changed files with 85 additions and 3 deletions

View File

@@ -5538,9 +5538,8 @@ print("ok")
if not target:
return {"success": False, "message": f"Component {reference} not found"}
# Calculate new rotation
current_rotation = target.get("rotation", 0)
new_rotation = (current_rotation + angle) % 360
# Use angle as absolute rotation (matches schema description)
new_rotation = angle % 360
# Use move_component with new rotation (position stays the same)
success = self.ipc_board_api.move_component(