Fixes:
- GraphItem reports pixel margins to improve auto-range - ViewBox.setRange is more careful about disabling auto range for axes that are set
This commit is contained in:
parent
58ed8ee7bd
commit
ccc5e6274a
@ -110,6 +110,11 @@ class GraphItem(GraphicsObject):
|
|||||||
def boundingRect(self):
|
def boundingRect(self):
|
||||||
return self.scatter.boundingRect()
|
return self.scatter.boundingRect()
|
||||||
|
|
||||||
|
def dataBounds(self, *args, **kwds):
|
||||||
|
return self.scatter.dataBounds(*args, **kwds)
|
||||||
|
|
||||||
|
def pixelPadding(self):
|
||||||
|
return self.scatter.pixelPadding()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -394,6 +394,8 @@ class ViewBox(GraphicsWidget):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
#print self.name, "ViewBox.setRange", rect, xRange, yRange, padding
|
#print self.name, "ViewBox.setRange", rect, xRange, yRange, padding
|
||||||
|
#import traceback
|
||||||
|
#traceback.print_stack()
|
||||||
|
|
||||||
changes = {} # axes
|
changes = {} # axes
|
||||||
setRequested = [False, False]
|
setRequested = [False, False]
|
||||||
@ -454,15 +456,11 @@ class ViewBox(GraphicsWidget):
|
|||||||
lockY = False
|
lockY = False
|
||||||
self.updateViewRange(lockX, lockY)
|
self.updateViewRange(lockX, lockY)
|
||||||
|
|
||||||
# Disable auto-range if needed
|
# Disable auto-range for each axis that was requested to be set
|
||||||
if disableAutoRange:
|
if disableAutoRange:
|
||||||
if all(changed):
|
xOff = False if setRequested[0] else None
|
||||||
ax = ViewBox.XYAxes
|
yOff = False if setRequested[1] else None
|
||||||
elif changed[0]:
|
self.enableAutoRange(x=xOff, y=yOff)
|
||||||
ax = ViewBox.XAxis
|
|
||||||
elif changed[1]:
|
|
||||||
ax = ViewBox.YAxis
|
|
||||||
self.enableAutoRange(ax, False)
|
|
||||||
changed.append(True)
|
changed.append(True)
|
||||||
|
|
||||||
# If nothing has changed, we are done.
|
# If nothing has changed, we are done.
|
||||||
@ -1376,7 +1374,7 @@ class ViewBox(GraphicsWidget):
|
|||||||
|
|
||||||
def updateMatrix(self, changed=None):
|
def updateMatrix(self, changed=None):
|
||||||
## Make the childGroup's transform match the requested viewRange.
|
## Make the childGroup's transform match the requested viewRange.
|
||||||
|
#print self.name, "updateMAtrix", self.state['targetRange']
|
||||||
#if changed is None:
|
#if changed is None:
|
||||||
#changed = [False, False]
|
#changed = [False, False]
|
||||||
#changed = list(changed)
|
#changed = list(changed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user