Don't even bother with text wrapping

This is a pretty useless feature, all things considered. It should
be the job of the application to figure that out.
This commit is contained in:
Sasha Koshka 2022-11-06 15:26:50 -05:00
parent f98b551ba2
commit 3abba9d69b

View File

@ -98,10 +98,7 @@ func (buffer *Buffer) Write (bytes []byte) (bytesWritten int, err error) {
for _, character := range text {
buffer.SetRune(buffer.Dot.X, buffer.Dot.Y, character)
buffer.Dot.X ++
if buffer.Dot.X > buffer.width || character == '\n' {
buffer.Dot.X = 0
buffer.Dot.Y ++
}
if buffer.Dot.X > buffer.width { break }
}
return
@ -150,10 +147,7 @@ func (buffer *DamageBuffer) Write (bytes []byte) (bytesWritten int, err error) {
for _, character := range text {
buffer.SetRune(buffer.Dot.X, buffer.Dot.Y, character)
buffer.Dot.X ++
if buffer.Dot.X > buffer.width || character == '\n' {
buffer.Dot.X = 0
buffer.Dot.Y ++
}
if buffer.Dot.X > buffer.width { break }
}
return