From 84a845185eb60aa8ad846ed8dc762ec6a2b613d0 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sun, 20 Oct 2013 11:06:57 -0400 Subject: [PATCH] Fix: when ViewBox is resized, update range if it is linked to another view --- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index d7fd49e5..e57ea1ee 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -308,7 +308,10 @@ class ViewBox(GraphicsWidget): ch.setParentItem(None) def resizeEvent(self, ev): + #print self.name, "ViewBox.resizeEvent", self.size() #self.setRange(self.range, padding=0) + self.linkedXChanged() + self.linkedYChanged() self.updateAutoRange() self.updateMatrix() self.sigStateChanged.emit(self) @@ -365,6 +368,7 @@ class ViewBox(GraphicsWidget): ============= ===================================================================== """ + #print self.name, "ViewBox.setRange", rect, xRange, yRange, padding changes = {} @@ -770,6 +774,7 @@ class ViewBox(GraphicsWidget): if self.linksBlocked or view is None: return + #print self.name, "ViewBox.linkedViewChanged", axis, view.viewRange()[axis] vr = view.viewRect() vg = view.screenGeometry() sg = self.screenGeometry()