diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index 36d85531..92ad3250 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -1903,15 +1903,15 @@ def _arrayToQPath_all(x, y, finiteCheck): numchunks = (n + chunksize - 1) // chunksize minchunks = 3 + backfill_idx = None + if finiteCheck and not all_isfinite: + backfill_idx = _compute_backfill_indices(isfinite) + if numchunks < minchunks: # too few chunks, batching would be a pessimization poly = create_qpolygonf(n) arr = ndarray_from_qpolygonf(poly) - backfill_idx = None - if finiteCheck and not all_isfinite: - backfill_idx = _compute_backfill_indices(isfinite) - if backfill_idx is None: arr[:, 0] = x arr[:, 1] = y @@ -1925,10 +1925,6 @@ def _arrayToQPath_all(x, y, finiteCheck): path.addPolygon(poly) return path - backfill_idx = None - if finiteCheck and not all_isfinite: - backfill_idx = _compute_backfill_indices(isfinite) - # at this point, we have numchunks >= minchunks path = QtGui.QPainterPath()