本文整理汇总了Golang中github.com/fogleman/gg.Context.SetLineJoin方法的典型用法代码示例。如果您正苦于以下问题:Golang Context.SetLineJoin方法的具体用法?Golang Context.SetLineJoin怎么用?Golang Context.SetLineJoin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/fogleman/gg.Context
的用法示例。
在下文中一共展示了Context.SetLineJoin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: draw
func (p *Path) draw(gc *gg.Context, trans *transformer) {
if len(p.Positions) <= 1 {
return
}
gc.ClearPath()
gc.SetLineWidth(p.Weight)
gc.SetLineCap(gg.LineCapRound)
gc.SetLineJoin(gg.LineJoinRound)
for _, ll := range p.Positions {
gc.LineTo(trans.ll2p(ll))
}
gc.SetColor(p.Color)
gc.Stroke()
}
示例2: draw
func (m *Marker) draw(gc *gg.Context, trans *transformer) {
gc.ClearPath()
gc.SetLineJoin(gg.LineJoinRound)
gc.SetLineWidth(1.0)
radius := 0.5 * m.Size
x, y := trans.ll2p(m.Position)
gc.DrawArc(x, y-m.Size, radius, (90.0+60.0)*math.Pi/180.0, (360.0+90.0-60.0)*math.Pi/180.0)
gc.LineTo(x, y)
gc.ClosePath()
gc.SetColor(m.Color)
gc.FillPreserve()
gc.SetRGB(0, 0, 0)
gc.Stroke()
if m.Label != "" {
if Luminance(m.Color) >= 0.5 {
gc.SetColor(color.RGBA{0x00, 0x00, 0x00, 0xff})
} else {
gc.SetColor(color.RGBA{0xff, 0xff, 0xff, 0xff})
}
gc.DrawStringAnchored(m.Label, x, y-m.Size, 0.5, 0.5)
}
}