PolyLineROI's segmentClicked adds Handle and segment in wrong location after being scaled with a scale handle

10 views
Skip to first unread message

Daniel

unread,
Aug 22, 2019, 1:26:43 AM8/22/19
to pyqtgraph
This can be seen in examples/ROIExamples.py, by changing lines 86-87 to the following:

r2a = pg.PolyLineROI([[0,0], [10,10], [10,30], [30,10]], closed=True)
pts
= np.array([[0,0], [10,10], [10,30], [30,10]])
center
= pts.mean(0)
min = np.min(pts, axis=0)
max = np.max(pts, axis=0)
r2a
.addScaleHandle(min, center)
r2a
.addScaleHandle(max, center)
v2a
.addItem(r2a)

Before scaling the ROI using the scale handle, left-clicking a segment adds a Handle (and implicit segment) at the correct clicked location.
After scaling the ROI using the scale handle, left-clicking a segment adds a Handle (and implicit segment) at a completely wrong location, drastically changing the shape of the ROI.

Is this the expected behaviour and am I using the scale handles on the PolyLineROI incorrectly? Or is there some other correct way of having scale handles on a PolyLineROI?

Thanks!

(Using pyqtgraph 0.10.0, PyQt5 5.12.3, Qt 5.12.4, and python 3.7.3)
Reply all
Reply to author
Forward
0 new messages