本文整理匯總了Golang中github.com/google/gxui.Canvas.DrawCanvas方法的典型用法代碼示例。如果您正苦於以下問題:Golang Canvas.DrawCanvas方法的具體用法?Golang Canvas.DrawCanvas怎麽用?Golang Canvas.DrawCanvas使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/google/gxui.Canvas
的用法示例。
在下文中一共展示了Canvas.DrawCanvas方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: PaintProgress
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()
}
示例2: Paint
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)
}
示例3: PaintChild
func (p *PaintChildren) PaintChild(c gxui.Canvas, child *gxui.Child, idx int) {
if canvas := child.Control.Draw(); canvas != nil {
c.DrawCanvas(canvas, child.Offset)
}
}