mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 09:15:21 +00:00
Fix warning when aggregate decorator cannot be drawn on the screen.
This commit is contained in:
@@ -270,6 +270,8 @@ class AggregateModeDecorator:
|
|||||||
blf.color(self.font_id, *color)
|
blf.color(self.font_id, *color)
|
||||||
text = aggregate_obj.name
|
text = aggregate_obj.name
|
||||||
text_coords = view3d_utils.location_3d_to_region_2d(region, rv3d, aggregate_obj.location)
|
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_length = blf.dimensions(self.font_id, text)
|
||||||
text_coords[0] -= text_length[0] / 2
|
text_coords[0] -= text_length[0] / 2
|
||||||
text_coords[1] -= 20
|
text_coords[1] -= 20
|
||||||
|
|||||||
Reference in New Issue
Block a user