improve chunking preformance

This commit is contained in:
Richard Schreiber
2025-11-06 08:26:04 +01:00
parent 97b6a7f97a
commit 7d34cf9f3f
+6 -2
View File
@@ -793,9 +793,13 @@ class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
p_style = self.stylesheet['Fineprint']
continue
if h > max_height * 1.25:
if not description_p_list:
# first "manual" line is larger than 8 "real" lines => only allow one line and set rest in Fineprint
max_height = self.stylesheet['Normal'].leading
if h > max_height * 1.1:
# quickly bring the text-length down to a managable length to then stepwise reduce
wrap_to = math.ceil(len(curr_description) * max_height * 1.25 / h)
wrap_to = math.ceil(len(curr_description) * max_height * 1.1 / h)
else:
# long trimming long texts by percent creates to big jumps, but trimming short texts
# by e.g. static 10 chars might be to much also