Fix anchor origin calculation