|
26 | 26 | from .config import rc
|
27 | 27 | from .utils import edges, edges2d, units, to_xyz, to_rgb
|
28 | 28 | from .internals import ic # noqa: F401
|
29 |
| -from .internals import docstring, warnings, _not_none |
| 29 | +from .internals import docstring, warnings, _version, _version_cartopy, _not_none |
30 | 30 | try:
|
31 | 31 | from cartopy.crs import PlateCarree
|
32 | 32 | except ModuleNotFoundError:
|
@@ -209,13 +209,13 @@ def default_crs(self, func, *args, crs=None, **kwargs):
|
209 | 209 | args, crs = args[:-1], args[-1]
|
210 | 210 | result = func(self, *args, crs=crs, **kwargs)
|
211 | 211 |
|
212 |
| - # Fix extent, so axes tight bounding box gets correct box! |
213 |
| - # From this issue: |
| 212 | + # Fix extent, so axes tight bounding box gets correct box! From this issue: |
214 | 213 | # https://github.com/SciTools/cartopy/issues/1207#issuecomment-439975083
|
215 |
| - if name == 'set_extent' and hasattr(self.outline_patch, 'orig_path'): |
216 |
| - clipped_path = self.outline_patch.orig_path.clip_to_bbox(self.viewLim) |
217 |
| - self.outline_patch._path = clipped_path |
218 |
| - self.background_patch._path = clipped_path |
| 214 | + if _version_cartopy < _version('0.18'): |
| 215 | + if name == 'set_extent': |
| 216 | + clipped_path = self.outline_patch.orig_path.clip_to_bbox(self.viewLim) |
| 217 | + self.outline_patch._path = clipped_path |
| 218 | + self.background_patch._path = clipped_path |
219 | 219 | return result
|
220 | 220 |
|
221 | 221 |
|
|
0 commit comments