From 4beea8a153b98a24740132225a62f0ecae6d41d4 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Mon, 18 Sep 2017 13:31:32 -0700 Subject: [PATCH] Prevent viewbox auto-scaling to items that are not in the same scene. This can happen when an item that was previously added to the viewbox is then removed using scene.removeItem(). --- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index 8ade0c6b..c125babf 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -1280,7 +1280,7 @@ class ViewBox(GraphicsWidget): ## First collect all boundary information itemBounds = [] for item in items: - if not item.isVisible(): + if not item.isVisible() or not item.scene() is self.scene(): continue useX = True