CanvasBox no longer crashes on nil drawer

This commit is contained in:
Sasha Koshka 2024-06-19 12:13:31 -04:00
parent caa261665f
commit e23e794730

View File

@ -30,6 +30,8 @@ func (this *canvasBox) Invalidate () {
func (this *canvasBox) Draw (can canvas.Canvas) { func (this *canvasBox) Draw (can canvas.Canvas) {
this.box.Draw(can) this.box.Draw(can)
if this.userDrawer != nil {
this.userDrawer.Draw ( this.userDrawer.Draw (
can.SubCanvas(this.padding.Apply(this.innerClippingBounds))) can.SubCanvas(this.padding.Apply(this.innerClippingBounds)))
} }
}