From 35d279165774ce1d3df54f2743e9562bc5fbaf06 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 23 Jan 2025 20:29:21 +1100 Subject: [PATCH] Fix warning when aggregate decorator cannot be drawn on the screen. --- src/bonsai/bonsai/bim/module/aggregate/decorator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/aggregate/decorator.py b/src/bonsai/bonsai/bim/module/aggregate/decorator.py index a7f9f41658..74ab48e661 100644 --- a/src/bonsai/bonsai/bim/module/aggregate/decorator.py +++ b/src/bonsai/bonsai/bim/module/aggregate/decorator.py @@ -270,6 +270,8 @@ class AggregateModeDecorator: blf.color(self.font_id, *color) text = aggregate_obj.name text_coords = view3d_utils.location_3d_to_region_2d(region, rv3d, aggregate_obj.location) + if not text_coords: + return text_length = blf.dimensions(self.font_id, text) text_coords[0] -= text_length[0] / 2 text_coords[1] -= 20