fix: 修复在极端情况下可能导致部分样式错乱问题

This commit is contained in:
hstyi
2025-01-10 18:27:09 +08:00
committed by hstyi
parent 5c4acf85e8
commit 49cef39b8b
2 changed files with 6 additions and 2 deletions

View File

@@ -86,7 +86,11 @@ class TerminalLine {
if (chars.size() > i) {
if (chars.get(i).isNull) {
chars.set(i, Char.Space)
styles.set(i, TextStyle.Default)
// 如果等于默认,那么替换成当前的样式
// 如果不是默认,那么不需要替换样式
if (styles.getTextStyle(i) == TextStyle.Default) {
styles.set(i, buffer.style)
}
}
} else {
break

View File

@@ -298,7 +298,7 @@ class TerminalDisplay(
g.drawLine(xOffset, ly, xOffset + charWidth, ly)
}
// 删除线
// 双下划线
if (textStyle.doublyUnderline) {
if (textStyle.underline) {
g.drawLine(xOffset, i * lineHeight - 3, xOffset + charWidth, i * lineHeight - 3)