More concise visibility setting logic

This commit is contained in:
Kenneth Lyons 2019-06-07 13:32:25 -07:00 committed by GitHub
parent a2fb00633a
commit 1839c5ef59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,10 +46,7 @@ class ErrorBarItem(GraphicsObject):
This method was added in version 0.9.9. For prior versions, use setOpts.
"""
self.opts.update(opts)
if self.opts['x'] is None or self.opts['y'] is None:
self.setVisible(False)
else:
self.setVisible(True)
self.setVisible(all(self.opts[ax] is not None for ax in ['x', 'y']))
self.path = None
self.update()
self.prepareGeometryChange()