Finally fixed rotated rendering bug.