mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 22:12:32 +00:00
Fix measurement area text position.
This commit is contained in:
@@ -585,6 +585,8 @@ class PolylineDecorator:
|
|||||||
|
|
||||||
# Area and Length text
|
# Area and Length text
|
||||||
polyline_verts = [Vector((p.x, p.y, p.z)) for p in polyline_points]
|
polyline_verts = [Vector((p.x, p.y, p.z)) for p in polyline_points]
|
||||||
|
if polyline_verts[0] == polyline_verts[-1]:
|
||||||
|
polyline_verts = polyline_verts[:-1]
|
||||||
center = sum(polyline_verts, Vector()) / len(polyline_verts) # Center between all polyline points
|
center = sum(polyline_verts, Vector()) / len(polyline_verts) # Center between all polyline points
|
||||||
area_text_coords = view3d_utils.location_3d_to_region_2d(region, rv3d, center)
|
area_text_coords = view3d_utils.location_3d_to_region_2d(region, rv3d, center)
|
||||||
total_length_text_coords = view3d_utils.location_3d_to_region_2d(region, rv3d, polyline_verts[-1])
|
total_length_text_coords = view3d_utils.location_3d_to_region_2d(region, rv3d, polyline_verts[-1])
|
||||||
|
|||||||
Reference in New Issue
Block a user