mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix kneeboard notes bug
This commit is contained in:
parent
b2c38f454f
commit
06f51573e1
@ -171,14 +171,14 @@ class KneeboardPageWriter:
|
||||
def wrap_line_with_font(
|
||||
inputstr: str, max_width: int, font: ImageFont.FreeTypeFont
|
||||
) -> str:
|
||||
if font.getsize(inputstr)[0] <= max_width: # type:ignore[attr-defined]
|
||||
if font.getlength(inputstr) <= max_width:
|
||||
return inputstr
|
||||
tokens = inputstr.split(" ")
|
||||
output = ""
|
||||
segments = []
|
||||
for token in tokens:
|
||||
combo = output + " " + token
|
||||
if font.getsize(combo)[0] > max_width: # type:ignore[attr-defined]
|
||||
if font.getlength(combo) > max_width:
|
||||
segments.append(output + "\n")
|
||||
output = token
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user