Fixed CoreControl background drawing behavior

... But found a bug with the border pattern
This commit is contained in:
Sasha Koshka 2023-04-02 22:16:12 -04:00
parent 6ede0d0770
commit 6c3230c0f8
2 changed files with 12 additions and 1 deletions

View File

@ -140,7 +140,7 @@ func (control CoreControl) DrawBackgroundBounds (
if ok {
parent.DrawBackground(bounds)
} else if fallback != nil {
fallback.Draw(control, bounds)
fallback.Draw(canvas.Cut(control, bounds), control.Bounds())
}
}

View File

@ -123,6 +123,17 @@ func (element *Artist) draw () {
Inset: artist.Inset { 8, 8, 8, 8 },
}.Draw(c13, c13.Bounds().Inset(10))
// 2, 3
c23 := element.cellAt(2, 3)
patterns.Border {
Canvas: element.thingy(c42),
Inset: artist.Inset { 8, 8, 8, 8 },
}.Draw(c23, c23.Bounds())
patterns.Border {
Canvas: element.thingy(c42),
Inset: artist.Inset { 8, 8, 8, 8 },
}.Draw(canvas.Cut(c23, c23.Bounds().Inset(16)), c23.Bounds())
// how long did that take to render?
drawTime := time.Since(drawStart)
textDrawer := textdraw.Drawer { }