Exemplo n.º 1
0
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()
}
Exemplo n.º 2
0
Arquivo: image.go Projeto: langxj/gxui
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)
}
Exemplo n.º 3
0
func (p *PaintChildren) PaintChild(c gxui.Canvas, child *gxui.Child, idx int) {
	if canvas := child.Control.Draw(); canvas != nil {
		c.DrawCanvas(canvas, child.Offset)
	}
}