Code to reproduce
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtWidgets
from pyqtgraph import PolyLineROI
app = pg.mkQApp("Arrow Example")
w = QtWidgets.QMainWindow()
cw = pg.GraphicsLayoutWidget()
w.show()
w.resize(1600, 900)
w.setCentralWidget(cw)
p = cw.addPlot(row=0, col=0)
ls = PolyLineROI([[0, 0], [1, 1], [2, 0]])
p.addItem(ls)
print(ls.getState())
ls.rotate(angle=90, center=[1, 1])
print(ls.getState())
p.setRange(QtCore.QRectF(-20, -10, 60, 20))
ls.setPoints([[0, 0], [1, 1], [2, 9]])
if __name__ == '__main__':
pg.exec()
Expected behavior
the result of getState should update after rotate. And the follow-up setPoints should be functional.
Real behavior
the ROI become strange after setPoints image