Use default colors instead last, when padding rows from an ANSI file

I'm not sure whether it should continue the color at the end of a row,
or if it should use the default color, but before, it used the last
color set in the entire file, even for earlier rows,
so this is at least better than that.
This commit is contained in:
Isaiah Odhner 2023-05-03 17:01:44 -04:00
parent 426354e986
commit 3ae8af3ad7

View File

@ -867,13 +867,12 @@ class AnsiArtDocument:
raise ValueError("Unknown instruction type")
document.width = width
document.height = height
# Fill in the rest of the lines
# just using the last color, not sure if that's correct...
# Pad rows to a consistent width.
for y in range(document.height):
for x in range(document.width - len(document.ch[y])):
document.ch[y].append(' ')
document.bg[y].append(bg_color)
document.fg[y].append(fg_color)
document.bg[y].append(default_bg)
document.fg[y].append(default_fg)
return document
@staticmethod