remove deprecation from boundingbox

This commit is contained in:
leyghisbb 2020-08-30 12:17:19 +02:00
parent 8a9df3ab5e
commit 077934829e

View File

@ -12,8 +12,7 @@ class DrawBBoxes(inkex.Effect):
self.arg_parser.add_argument('--circle', type=inkex.Boolean, default=0.0, help='Draw circles') self.arg_parser.add_argument('--circle', type=inkex.Boolean, default=0.0, help='Draw circles')
self.arg_parser.add_argument('--split', type = inkex.Boolean, default = True, help = 'Handle selection as group') self.arg_parser.add_argument('--split', type = inkex.Boolean, default = True, help = 'Handle selection as group')
def drawBBox(self, node): def drawBBox(self, bbox):
bbox = node.bounding_box()
if self.options.box: if self.options.box:
attribs = { attribs = {
'style' : str(inkex.Style({'stroke':'#ff0000','stroke-width' : '1','fill':'none'})), 'style' : str(inkex.Style({'stroke':'#ff0000','stroke-width' : '1','fill':'none'})),
@ -38,8 +37,8 @@ class DrawBBoxes(inkex.Effect):
if len(self.svg.selected) > 0: if len(self.svg.selected) > 0:
if self.options.split is False: if self.options.split is False:
for id, item in self.svg.selected.items(): for id, item in self.svg.selected.items():
self.drawBBox(item) self.drawBBox(item.bounding_box())
else: else:
self.drawBBox(self.svg.selected) self.drawBBox(self.svg.selection.bounding_box())
DrawBBoxes().run() DrawBBoxes().run()