Fix position bounds and spacing logic in Zukitchi widget rendering

This commit is contained in:
Arindy 2026-01-02 17:02:37 +01:00
parent 21ac083ef0
commit 915087d31a

View File

@ -77,13 +77,13 @@ func cutFirstAndListLineAndMove(frame string, position int) string {
if position < 0 {
position = 0
}
if position > 35 {
position = 35
if position > 34 {
position = 34
}
lines := strings.Split(frame, "\n")
result := make([]string, 0, len(lines))
for _, line := range lines {
result = append(result, strings.Repeat(" ", position)+line+strings.Repeat(" ", 36-position))
result = append(result, strings.Repeat(" ", position)+line+strings.Repeat(" ", 35-position))
}
return strings.Join(result[1:len(result)-1], "\n")
}