Buffer, DamageBuffer, and Application are io.Writers

This commit is contained in:
Sasha Koshka 2022-11-06 14:17:43 -05:00
parent 18ea5681de
commit 4b129a8391
3 changed files with 79 additions and 31 deletions

View File

@ -19,6 +19,7 @@ type Backend struct {
backgroundStamper *imdraw.IMDraw backgroundStamper *imdraw.IMDraw
fontAtlas *text.Atlas fontAtlas *text.Atlas
textDrawer *text.Text textDrawer *text.Text
showBounds bool
metrics struct { metrics struct {
cellWidth int cellWidth int
@ -177,6 +178,8 @@ func (backend *Backend) draw () {
} }
} }
// draw a rectangle around the buffer if we are showing bounds
if backend.showBounds {
backend.backgroundStamper.Clear() backend.backgroundStamper.Clear()
backend.backgroundStamper.Color = backend.backgroundStamper.Color =
backend.config.Color(stone.ColorBackground) backend.config.Color(stone.ColorBackground)