fix divison by zero when determining xStep when rendering