當前位置: 首頁>>代碼示例>>Golang>>正文


Golang PathBuilder.Close方法代碼示例

本文整理匯總了Golang中github.com/maleck13/jigsaw/Godeps/_workspace/src/github.com/llgcode/draw2d.PathBuilder.Close方法的典型用法代碼示例。如果您正苦於以下問題:Golang PathBuilder.Close方法的具體用法?Golang PathBuilder.Close怎麽用?Golang PathBuilder.Close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/maleck13/jigsaw/Godeps/_workspace/src/github.com/llgcode/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:maleck13,項目名稱:jigsaws,代碼行數: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:maleck13,項目名稱:jigsaws,代碼行數: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:maleck13,項目名稱:jigsaws,代碼行數: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:maleck13,項目名稱:jigsaws,代碼行數:5,代碼來源:draw2dkit.go


注:本文中的github.com/maleck13/jigsaw/Godeps/_workspace/src/github.com/llgcode/draw2d.PathBuilder.Close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。