当前位置: 首页>>代码示例>>Golang>>正文


Golang PathBuilder.Close方法代码示例

本文整理汇总了Golang中github.com/julianshen/draw2d.PathBuilder.Close方法的典型用法代码示例。如果您正苦于以下问题:Golang PathBuilder.Close方法的具体用法?Golang PathBuilder.Close怎么用?Golang PathBuilder.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/julianshen/draw2d.PathBuilder的用法示例。


在下文中一共展示了PathBuilder.Close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Rectangle

// Rectangle draws a rectangle using a path between (x1,y1) and (x2,y2)
func Rectangle(path draw2d.PathBuilder, x1, y1, x2, y2 float64) {
	path.MoveTo(x1, y1)
	path.LineTo(x2, y1)
	path.LineTo(x2, y2)
	path.LineTo(x1, y2)
	path.Close()
}
开发者ID:julianshen,项目名称:draw2d,代码行数:8,代码来源:draw2dkit.go

示例2: RoundedRectangle

// RoundedRectangle draws a rectangle using a path between (x1,y1) and (x2,y2)
func RoundedRectangle(path draw2d.PathBuilder, x1, y1, x2, y2, arcWidth, arcHeight float64) {
	arcWidth = arcWidth / 2
	arcHeight = arcHeight / 2
	path.MoveTo(x1, y1+arcHeight)
	path.QuadCurveTo(x1, y1, x1+arcWidth, y1)
	path.LineTo(x2-arcWidth, y1)
	path.QuadCurveTo(x2, y1, x2, y1+arcHeight)
	path.LineTo(x2, y2-arcHeight)
	path.QuadCurveTo(x2, y2, x2-arcWidth, y2)
	path.LineTo(x1+arcWidth, y2)
	path.QuadCurveTo(x1, y2, x1, y2-arcHeight)
	path.Close()
}
开发者ID:julianshen,项目名称:draw2d,代码行数:14,代码来源:draw2dkit.go

示例3: Circle

// Circle draws a circle using a path with center (cx,cy) and radius
func Circle(path draw2d.PathBuilder, cx, cy, radius float64) {
	path.ArcTo(cx, cy, radius, radius, 0, -math.Pi*2)
	path.Close()
}
开发者ID:julianshen,项目名称:draw2d,代码行数:5,代码来源:draw2dkit.go

示例4: Ellipse

// Ellipse draws an ellipse using a path with center (cx,cy) and radius (rx,ry)
func Ellipse(path draw2d.PathBuilder, cx, cy, rx, ry float64) {
	path.ArcTo(cx, cy, rx, ry, 0, -math.Pi*2)
	path.Close()
}
开发者ID:julianshen,项目名称:draw2d,代码行数:5,代码来源:draw2dkit.go


注:本文中的github.com/julianshen/draw2d.PathBuilder.Close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。