mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
IFC Text Multiple literals now displayed in viewport separated by newline
This commit is contained in:
@@ -2110,16 +2110,11 @@ class TextDecorator(BaseDecorator):
|
|||||||
idxs = [(0, 0)]
|
idxs = [(0, 0)]
|
||||||
self.draw_lines(context, obj, verts, idxs)
|
self.draw_lines(context, obj, verts, idxs)
|
||||||
|
|
||||||
box_alignment_used = []
|
line_i = 0
|
||||||
for literal_data in literals_data:
|
for literal_data in literals_data:
|
||||||
box_alignment = literal_data["BoxAlignment"]
|
box_alignment = literal_data["BoxAlignment"]
|
||||||
# Skip literals with the same box alignment to prevent visual clutter in viewport
|
|
||||||
# User is still indicated by the asterisk symbol
|
|
||||||
if box_alignment in box_alignment_used:
|
|
||||||
continue
|
|
||||||
box_alignment_used.append(box_alignment)
|
|
||||||
|
|
||||||
for line_i, line in enumerate(literal_data["CurrentValue"].split("\\n")):
|
for line in literal_data["CurrentValue"].split("\\n"):
|
||||||
self.draw_label(
|
self.draw_label(
|
||||||
context,
|
context,
|
||||||
line,
|
line,
|
||||||
@@ -2132,6 +2127,7 @@ class TextDecorator(BaseDecorator):
|
|||||||
line_no=line_i,
|
line_no=line_i,
|
||||||
box_alignment=box_alignment,
|
box_alignment=box_alignment,
|
||||||
)
|
)
|
||||||
|
line_i += 1
|
||||||
|
|
||||||
|
|
||||||
class DecorationsHandler:
|
class DecorationsHandler:
|
||||||
|
|||||||
Reference in New Issue
Block a user