Skip to content

Commit bc1439f

Browse files
Move 3d reprojection code to correct
zorder handling...
1 parent aea17cf commit bc1439f

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

matplotview/_view_axes.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ def draw(self, renderer: RendererBase):
4242
# If we are working with a 3D object, swap out it's axes with
4343
# this zoom axes (swapping out the 3d transform) and reproject it.
4444
if(hasattr(self._artist, "do_3d_projection")):
45-
ax = self._artist.axes
46-
self._artist.axes = None
47-
self._artist.axes = self._renderer.bounding_axes
48-
self._artist.do_3d_projection()
49-
self._artist.axes = None
50-
self._artist.axes = ax
45+
self.do_3d_projection()
5146

5247
# Check and see if the passed limiting box and extents of the
5348
# artist intersect, if not don't bother drawing this artist.
@@ -57,6 +52,18 @@ def draw(self, renderer: RendererBase):
5752
# Re-enable the clip box...
5853
self._artist.set_clip_box(clip_box_orig)
5954

55+
def do_3d_projection(self):
56+
do_3d_projection = getattr(self._artist, "do_3d_projection")
57+
58+
ax = self._artist.axes
59+
self._artist.axes = None
60+
self._artist.axes = self._renderer.bounding_axes
61+
res = do_3d_projection()
62+
self._artist.axes = None
63+
self._artist.axes = ax
64+
65+
return res
66+
6067

6168
def view_wrapper(axes_class: Type[Axes]) -> Type[Axes]:
6269
"""

0 commit comments

Comments
 (0)