added handling for non-selection in boundingbox extension

This commit is contained in:
Mario Voigt 2021-04-02 10:18:33 +02:00
parent d91068f11a
commit c080b34abb
1 changed files with 5 additions and 0 deletions

View File

@ -39,8 +39,13 @@ class DrawBBoxes(inkex.Effect):
for id, item in self.svg.selected.items():
self.drawBBox(item.bounding_box())
else:
inkex.utils.debug("")
#self.drawBBox(self.svg.get_selected_bbox()) #works for InkScape (1:1.0+devel+202008292235+eff2292935) @ Linux and for Windows (but with deprecation)
self.drawBBox(self.svg.selection.bounding_box()) #works for InkScape 1.1dev (9b1fc87, 2020-08-27)) @ Windows
else:
inkex.errormsg('Please select some objects first.')
return
if __name__ == '__main__':
DrawBBoxes().run()