Taking into account the sprite's origin.