Skip to content

Commit

Permalink
On macOS, mlab.view(figure=_f) returns None under testing backend
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbrodbeck committed Mar 28, 2017
1 parent a70737b commit 4f631d1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions surfer/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,22 +522,21 @@ def _toggle_render(self, state, views=None):
if views is None:
views = [None] * len(figs)
for vi, (_f, view) in enumerate(zip(figs, views)):
# Testing backend doesn't have these options
if mlab.options.backend == 'test':
continue

if state is False and view is None:
views[vi] = (mlab.view(figure=_f),
# scene is None in testing backend
1 if _f.scene is None else
_f.scene.camera.parallel_scale)

# Testing backend doesn't have this option
if mlab.options.backend != 'test':
_f.scene.disable_render = not state
_f.scene.disable_render = not state

if state is True and view is not None:
mlab.draw(figure=_f)
with warnings.catch_warnings(record=True): # traits focalpoint
mlab.view(*view[0], figure=_f)
if _f.scene is not None:
_f.scene.camera.parallel_scale = view[1]
_f.scene.camera.parallel_scale = view[1]
# let's do the ugly force draw
if state is True:
_force_render(self._figures, self._window_backend)
Expand Down

0 comments on commit 4f631d1

Please sign in to comment.