Skip to content

Commit

Permalink
Merge pull request slaclab#1070 from jbellister-slac/fix_plots
Browse files Browse the repository at this point in the history
FIX: MultiAxisViewBox resizing breaks in certain cases
  • Loading branch information
YektaY authored Apr 10, 2024
2 parents a4a3685 + 157f5d4 commit 56f94b4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pydm/widgets/multi_axis_viewbox.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pyqtgraph import ViewBox
from qtpy.QtCore import Qt, Signal
from pyqtgraph import GraphicsWidget, ViewBox
from qtpy.QtCore import Qt, QRectF, Signal


class MultiAxisViewBox(ViewBox):
Expand All @@ -17,6 +17,14 @@ class MultiAxisViewBox(ViewBox):
sigMouseWheelZoomed = Signal(object, object, object)
sigHistoryChanged = Signal(object)

def boundingRect(self) -> QRectF:
"""Bypass the ViewBox implementation of boundingRect which gives us extra padding we don't want in pydm"""
return GraphicsWidget.boundingRect(self)

def sceneBoundingRect(self) -> QRectF:
"""Bypass the ViewBox implementation of sceneBoundingRect which gives us extra padding we don't want in pydm"""
return GraphicsWidget.sceneBoundingRect(self)

def wheelEvent(self, ev, axis=None, fromSignal=False):
"""
Handles user input from the mouse wheel. Propagates to any stacked views.
Expand Down

0 comments on commit 56f94b4

Please sign in to comment.