Don't let axis item reduce space

This commit is contained in:
Ogi Moore 2020-06-23 22:22:51 -07:00
parent a192707654
commit b8abd5d02e
2 changed files with 5 additions and 5 deletions

View File

@ -359,7 +359,7 @@ class AxisItem(GraphicsWidget):
if self.fixedHeight is None:
if not self.style['showValues']:
h = 0
elif self.style['autoExpandTextSpace'] is True:
elif self.style['autoExpandTextSpace']:
h = self.textHeight
else:
h = self.style['tickTextHeight']
@ -390,7 +390,7 @@ class AxisItem(GraphicsWidget):
if self.fixedWidth is None:
if not self.style['showValues']:
w = 0
elif self.style['autoExpandTextSpace'] is True:
elif self.style['autoExpandTextSpace']:
w = self.textWidth
else:
w = self.style['tickTextWidth']

View File

@ -21,19 +21,19 @@ def test_ErrorBarItem_defer_data():
app.processEvents()
r_empty_ebi = plot.viewRect()
assert r_no_ebi == r_empty_ebi
assert r_no_ebi.height() == r_empty_ebi.height()
err.setData(x=x, y=x, bottom=x, top=x)
app.processEvents()
r_ebi = plot.viewRect()
assert r_empty_ebi != r_ebi
assert r_ebi.height() > r_empty_ebi.height()
# unset data, ErrorBarItem disappears and view rect goes back to original
err.setData(x=None, y=None)
app.processEvents()
r_clear_ebi = plot.viewRect()
assert r_clear_ebi == r_no_ebi
assert r_clear_ebi.height() == r_empty_ebi.height()
plot.close()