Don't let axis item reduce space
This commit is contained in:
parent
a192707654
commit
b8abd5d02e
@ -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']
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user