Ejemplo n.º 1
0
func (self *Surface) FillExtents() (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_fill_extents(self.context, px1, py1, px2, py2)
	left = float64(*px1)
	top = float64(*py1)
	right = float64(*px2)
	bottom = float64(*py2)
	return
}
Ejemplo n.º 2
0
func (self *Surface) FillExtents() (left, top, right, bottom float64) {
	C.cairo_fill_extents(self.context,
		(*C.double)(&left), (*C.double)(&top),
		(*C.double)(&right), (*C.double)(&bottom))
	return left, top, right, bottom
}
Ejemplo n.º 3
0
// FillExtents is a wrapper around cairo_fill_extents().
func (v *Context) FillExtents() (x1, y1, x2, y2 float64) {
	var cx1, cy1, cx2, cy2 C.double
	C.cairo_fill_extents(v.native(), &cx1, &cy1, &cx2, &cy2)
	return float64(cx1), float64(cy1), float64(cx2), float64(cy2)
}
Ejemplo n.º 4
0
//FillExtents computes a bounding box in user coordinates covering the area that
//would be affected, (the "inked" area), by a Fill operation given the current
//path and fill parameters.
//If the current path is empty, it returns ZR.
//Surface dimensions and clipping are not taken into account.
//
//Contrast with PathExtents, which is similar, but returns non-zero extents
//for some paths with no inked area, (such as a simple line segment).
//
//FillExtents must necessarily do more work to compute the precise inked areas
//in light of the fill rule, so PathExtents may be more desirable for sake of
//performance if the non-inked path extents are desired.
//
//Originally cairo_fill_extents.
func (c *Context) FillExtents() Rectangle {
	var x1, y1, x2, y2 C.double
	C.cairo_fill_extents(c.c, &x1, &y1, &x2, &y2)
	return cRect(x1, y1, x2, y2)
}