Avoid null index race-error during startup
parent
999d3efdd7
commit
1aaa382036
|
@ -109,11 +109,12 @@ class LineDot(pg.CurvePoint):
|
||||||
# first = self._plot._arrays['ohlc'][0]['index']
|
# first = self._plot._arrays['ohlc'][0]['index']
|
||||||
# first = x[0]
|
# first = x[0]
|
||||||
# i = index - first
|
# i = index - first
|
||||||
i = index - x[0]
|
if index:
|
||||||
if i > 0 and i < len(y):
|
i = index - x[0]
|
||||||
newPos = (index, y[i])
|
if i > 0 and i < len(y):
|
||||||
QtWidgets.QGraphicsItem.setPos(self, *newPos)
|
newPos = (index, y[i])
|
||||||
return True
|
QtWidgets.QGraphicsItem.setPos(self, *newPos)
|
||||||
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue