Fix wrong offset after rotation