示例#1
0
文件: cairo.go 项目: raichu/gotk3
// Arc is a wrapper around cairo_arc().
func (v *Context) Arc(xc, yc, radius, angle1, angle2 float64) {
	C.cairo_arc(v.native(), C.double(xc), C.double(yc), C.double(radius), C.double(angle1), C.double(angle2))
}
示例#2
0
func (self *Surface) Arc(xc, yc, radius, angle1, angle2 float64) {
	C.cairo_arc(self.context,
		C.double(xc), C.double(yc),
		C.double(radius),
		C.double(angle1), C.double(angle2))
}
示例#3
0
//Arc adds a circular arc along the surface of circle from fromAngle
//increasing to toAngle.
//
//If fromAngle < toAngle, then toAngle will be increased by 2π until
//fromAngle > toAngle.
//
//If there is a current point, an initial line segment will be added
//to the path to connect the current point to the beginning of the arc.
//If this initial line is undesired, call ClosePath before Arc.
//
//Angles are measured in radians.
//An angle of 0 is in the direction of the positive X axis in user space.
//An angle of π/2 radians (90°) is in the direction of the positive Y axis
//in user space.
//With the default transformation matrix, angles increase clockwise.
//
//To convert from degrees to radians use
//	degrees * π/180
//
//Arc gives the arc in the direction of increasing angles.
//Use ArcNegative to get the arc in the direction of decreasing
//angles.
//
//The arc is circular in user space.
//
//Originally cairo_arc.
func (c *Context) Arc(circle Circle, fromAngle, toAngle float64) *Context {
	x, y, r := circle.c()
	a1, a2 := C.double(fromAngle), C.double(toAngle)
	C.cairo_arc(c.c, x, y, r, a1, a2)
	return c
}