Pass showAxRect keyword arguments to setRange to allow caller to set padding, etc. (#1145)

Co-authored-by: Luke McNinch <lucas.c.mcninch.civ@mail.mil>
This commit is contained in:
lcmcninch 2020-04-03 18:33:21 -04:00 committed by GitHub
parent db67a256a9
commit a5dd549be1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1303,8 +1303,11 @@ class ViewBox(GraphicsWidget):
self.rbScaleBox.scale(r.width(), r.height())
self.rbScaleBox.show()
def showAxRect(self, ax):
self.setRange(ax.normalized()) # be sure w, h are correct coordinates
def showAxRect(self, ax, **kwargs):
"""Set the visible range to the given rectangle
Passes keyword arguments to setRange
"""
self.setRange(ax.normalized(), **kwargs) # be sure w, h are correct coordinates
self.sigRangeChangedManually.emit(self.state['mouseEnabled'])
def allChildren(self, item=None):