Skip to content

Commit 56f94b4

Browse files
authored
Merge pull request #1070 from jbellister-slac/fix_plots
FIX: MultiAxisViewBox resizing breaks in certain cases
2 parents a4a3685 + 157f5d4 commit 56f94b4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pydm/widgets/multi_axis_viewbox.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from pyqtgraph import ViewBox
2-
from qtpy.QtCore import Qt, Signal
1+
from pyqtgraph import GraphicsWidget, ViewBox
2+
from qtpy.QtCore import Qt, QRectF, Signal
33

44

55
class MultiAxisViewBox(ViewBox):
@@ -17,6 +17,14 @@ class MultiAxisViewBox(ViewBox):
1717
sigMouseWheelZoomed = Signal(object, object, object)
1818
sigHistoryChanged = Signal(object)
1919

20+
def boundingRect(self) -> QRectF:
21+
"""Bypass the ViewBox implementation of boundingRect which gives us extra padding we don't want in pydm"""
22+
return GraphicsWidget.boundingRect(self)
23+
24+
def sceneBoundingRect(self) -> QRectF:
25+
"""Bypass the ViewBox implementation of sceneBoundingRect which gives us extra padding we don't want in pydm"""
26+
return GraphicsWidget.sceneBoundingRect(self)
27+
2028
def wheelEvent(self, ev, axis=None, fromSignal=False):
2129
"""
2230
Handles user input from the mouse wheel. Propagates to any stacked views.

0 commit comments

Comments
 (0)