func (b *ProgressBar) PaintProgress(c gxui.Canvas, r math.Rect, frac float32) { r.Max.X = math.Lerp(r.Min.X, r.Max.X, frac) c.DrawRect(r, gxui.CreateBrush(gxui.Gray50)) c.Push() c.AddClip(r) c.DrawCanvas(b.chevrons, math.Point{X: b.scroll}) c.Pop() }
func (i *Image) Paint(c gxui.Canvas) { r := i.outer.Size().Rect() i.PaintBackground(c, r) switch { case i.texture != nil: c.DrawTexture(i.texture, i.calculateDrawRect()) case i.canvas != nil: c.DrawCanvas(i.canvas, math.ZeroPoint) } i.PaintBorder(c, r) }
func (p *PaintChildren) PaintChild(c gxui.Canvas, child *gxui.Child, idx int) { if canvas := child.Control.Draw(); canvas != nil { c.DrawCanvas(canvas, child.Offset) } }