add get_bounds_nonempty

This commit is contained in:
jan 2022-02-27 21:21:34 -08:00
commit 0471addd65
3 changed files with 24 additions and 1 deletions

View file

@ -332,7 +332,7 @@ class Path(Shape, metaclass=AutoSlots):
bounds = numpy.array([[+inf, +inf], [-inf, -inf]])
polys = self.to_polygons()
for poly in polys:
poly_bounds = poly.get_bounds()
poly_bounds = poly.get_bounds_nonempty()
bounds[0, :] = numpy.minimum(bounds[0, :], poly_bounds[0, :])
bounds[1, :] = numpy.maximum(bounds[1, :], poly_bounds[1, :])
else: