本文整理汇总了Golang中github.com/maleck13/jigsaw/Godeps/_workspace/src/github.com/llgcode/draw2d.GraphicContext.SetLineJoin方法的典型用法代码示例。如果您正苦于以下问题:Golang GraphicContext.SetLineJoin方法的具体用法?Golang GraphicContext.SetLineJoin怎么用?Golang GraphicContext.SetLineJoin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/maleck13/jigsaw/Godeps/_workspace/src/github.com/llgcode/draw2d.GraphicContext
的用法示例。
在下文中一共展示了GraphicContext.SetLineJoin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Dash
// Dash draws a line with a dash pattern
func Dash(gc draw2d.GraphicContext, x, y, width, height float64) {
sx, sy := width/162, height/205
gc.SetStrokeColor(image.Black)
gc.SetLineDash([]float64{height / 10, height / 50, height / 50, height / 50}, -50.0)
gc.SetLineCap(draw2d.ButtCap)
gc.SetLineJoin(draw2d.RoundJoin)
gc.SetLineWidth(height / 50)
gc.MoveTo(x+sx*60.0, y)
gc.LineTo(x+sx*60.0, y)
gc.LineTo(x+sx*162, y+sy*205)
rLineTo(gc, sx*-102.4, 0)
gc.CubicCurveTo(x+sx*-17, y+sy*205, x+sx*-17, y+sy*103, x+sx*60.0, y+sy*103.0)
gc.Stroke()
gc.SetLineDash(nil, 0.0)
}
示例2: Draw
// Draw a line with an angle with specified line cap and join
func Draw(gc draw2d.GraphicContext, cap draw2d.LineCap, join draw2d.LineJoin,
x0, y0, x1, y1, offset float64) {
gc.SetLineCap(cap)
gc.SetLineJoin(join)
// Draw thick line
gc.SetStrokeColor(color.NRGBA{0x33, 0x33, 0x33, 0xFF})
gc.SetLineWidth(30.0)
gc.MoveTo(x0, y0)
gc.LineTo((x0+x1)/2+offset, (y0+y1)/2)
gc.LineTo(x1, y1)
gc.Stroke()
// Draw thin helping line
gc.SetStrokeColor(color.NRGBA{0xFF, 0x33, 0x33, 0xFF})
gc.SetLineWidth(2.56)
gc.MoveTo(x0, y0)
gc.LineTo((x0+x1)/2+offset, (y0+y1)/2)
gc.LineTo(x1, y1)
gc.Stroke()
}