示例#1
0
文件: cairo.go 项目: zvin/gocairo
func (self *Surface) StrokeExtents() (left, top, right, bottom float64) {
	var x1, y1, x2, y2 float64
	px1 := (*C.double)(&x1)
	py1 := (*C.double)(&y1)
	px2 := (*C.double)(&x2)
	py2 := (*C.double)(&y2)
	C.cairo_stroke_extents(self.context, px1, py1, px2, py2)
	left = float64(*px1)
	top = float64(*py1)
	right = float64(*px2)
	bottom = float64(*py2)
	return
}
示例#2
0
func (self *Surface) StrokeExtents() (left, top, right, bottom float64) {
	C.cairo_stroke_extents(self.context,
		(*C.double)(&left), (*C.double)(&top),
		(*C.double)(&right), (*C.double)(&bottom))
	return left, top, right, bottom
}
示例#3
0
文件: cairo.go 项目: raichu/gotk3
// StrokeExtents is a wrapper around cairo_stroke_extents().
func (v *Context) StrokeExtents() (x1, y1, x2, y2 float64) {
	var cx1, cy1, cx2, cy2 C.double
	C.cairo_stroke_extents(v.native(), &cx1, &cy1, &cx2, &cy2)
	return float64(cx1), float64(cy1), float64(cx2), float64(cy2)
}
示例#4
0
//StrokeExtents computes a bounding box in user coordinates covering the area
//that would be affected, (the "inked" area), by a Stroke operation given the
//current path and stroke parameters.
//If the current path is empty, returns the empty rectangle ZR.
//Surface dimensions and clipping are not taken into account.
//
//Note that StrokeExtents must necessarily do more work to compute the precise
//inked areas in light of the stroke parameters, so PathExtents may be more
//desirable for sake of performance if non-inked path extents are desired.
//
//Originally cairo_stroke_extents.
func (c *Context) StrokeExtents() Rectangle {
	var x1, y1, x2, y2 C.double
	C.cairo_stroke_extents(c.c, &x1, &y1, &x2, &y2)
	return cRect(x1, y1, x2, y2)
}