Basic and fun elements conform to new API change

This commit is contained in:
Sasha Koshka 2023-03-12 01:15:36 -05:00
parent d31aee1ba8
commit 92e5822185
10 changed files with 37 additions and 34 deletions

View File

@ -176,7 +176,7 @@ func (element *Checkbox) draw () {
backgroundPattern.Draw(element.core, bounds) backgroundPattern.Draw(element.core, bounds)
pattern := element.theme.Pattern(theme.PatternButton, state) pattern := element.theme.Pattern(theme.PatternButton, state)
artist.DrawBounds(element.core, pattern, boxBounds) pattern.Draw(element.core, boxBounds)
textBounds := element.drawer.LayoutBounds() textBounds := element.drawer.LayoutBounds()
margin := element.theme.Margin(theme.PatternBackground) margin := element.theme.Margin(theme.PatternBackground)

View File

@ -138,7 +138,7 @@ func (element *Container) Disown (child elements.Element) {
} }
func (element *Container) clearChildEventHandlers (child elements.Element) { func (element *Container) clearChildEventHandlers (child elements.Element) {
child.DrawTo(nil) child.DrawTo(nil, image.Rectangle { })
child.OnDamage(nil) child.OnDamage(nil)
child.OnMinimumSizeChange(nil) child.OnMinimumSizeChange(nil)
if child0, ok := child.(elements.Focusable); ok { if child0, ok := child.(elements.Focusable); ok {
@ -203,7 +203,7 @@ func (element *Container) redoAll () {
// remove child canvasses so that any operations done in here will not // remove child canvasses so that any operations done in here will not
// cause a child to draw to a wack ass canvas. // cause a child to draw to a wack ass canvas.
for _, entry := range element.children { for _, entry := range element.children {
entry.DrawTo(nil) entry.DrawTo(nil, entry.Bounds)
} }
// do a layout // do a layout