Hi,

Looks like there is a bug there. The calculated bounding rectangles (used 
by the GraphicsView system for repaints etc) aren't taking into account the 
line width.
If you edit the boundingRect method of ROI.py to be:
    def boundingRect(self):
        pw = 0.5*self.currentPen.width()
        return QtCore.QRectF(-0.5*pw, -0.5*pw, pw+self.state['size'][0], pw+
self.state['size'][1])
then it seems to work. Unfortunately, you'll also need to modify any other 
ROI subclass (PolyLineROI etc) which override boundingRect() in a similar 
manner.

Patrick

On Wednesday, 11 March 2020 06:18:34 UTC+10:30, yunsong zhao wrote:
>
> Hi there, 
>
> I get a problem when using the ROI.
> If I set the width of the ROI's pen bigger than 1, it does not refresh 
> correctly when moved, as is shown in the following image .
> [image: img.png]
>
>
>
>
>
>
>
>
>
>
> To get the image, I modified the image analysis example as follows:
>
> roi = pg.ROI([-8, 14], [6, 5])
> roi.addScaleHandle([0.5, 1], [0.5, 0.5])
> roi.addScaleHandle([0, 0.5], [0.5, 0.5])
> roi.setPen("r", width=10) # I added this line
> p1.addItem(roi)
>
> roi.setZValue(10) 
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/11d68141-8a7f-4825-a5af-dc08d005187a%40googlegroups.com.

Reply via email to