This indeed looks like a bug. I created an issue for this if anyone wants 
to keep track of progress on fixing it:

https://github.com/pyqtgraph/pyqtgraph/issues/1141

On Tuesday, March 10, 2020 at 7:52:22 PM UTC-7, Patrick wrote:
>
> 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/15cd8ed6-9967-4f1b-8a7d-eaddf6d7e7e3%40googlegroups.com.

Reply via email to