예제 #1
0
파일: cairo.go 프로젝트: zvin/gocairo
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
}
예제 #2
0
파일: surface.go 프로젝트: ungerik/go-cairo
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
}
예제 #3
0
파일: cairo.go 프로젝트: raichu/gotk3
// 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)
}
예제 #4
0
파일: cairo.go 프로젝트: jimmyfrasche/cairo
//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)
}