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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user