Fix position offset

The position offset was rotated around the bottom-left coordinate of the
image rather than the center coordinate.