Added missing height factor in clipping code