diff --git a/src/Machina/RobotCursor.cs b/src/Machina/RobotCursor.cs index 0ce66cf..34d6075 100644 --- a/src/Machina/RobotCursor.cs +++ b/src/Machina/RobotCursor.cs @@ -1327,7 +1327,7 @@ internal void UndoToolTransformOnCursor(RobotCursor cursor, Tool tool, RobotLogg { // TODO: at some point in the future, check for translationFirst here Rotation newRot = Rotation.Combine(cursor.rotation, Rotation.Inverse(tool.TCPOrientation)); // postmultiplication by the inverse rotation - Vector worldVector = Vector.Rotation(tool.TCPPosition, cursor.rotation); + Vector worldVector = Vector.Rotation(tool.TCPPosition, newRot); Vector newPos = cursor.position - worldVector; cursor.prevPosition = cursor.position;