Beispiel #1
0
//CurrentPoint reports the current point of the current path.
//The current point is, conceptually, the final point reached by the path
//so far.
//
//The current point is returned in the user-space coordinate system.
//
//If there is no defined current point, or if c is in an error state,
//(ZP, false) will be returned.
//Otherwise the (cp, true) will be returned where cp is the current point.
//
//Most path constructions alter the current point.
//
//Some functions use and alter the current point, but do not otherwise change
//the current path, see ShowText.
//
//Some functions unset the current path, and, as a result, the current point,
//such as Fill.
//
//Originally cairo_has_current_point and cairo_get_current_point.
func (c *Context) CurrentPoint() (cp Point, defined bool) {
	has := C.cairo_has_current_point(c.c) == 1
	if !has {
		return
	}
	var x, y C.double
	C.cairo_get_current_point(c.c, &x, &y)
	return cPt(x, y), true
}
Beispiel #2
0
// GetCurrentPoint is a wrapper around cairo_get_current_point().
func (v *Context) GetCurrentPoint() (x, y float64) {
	C.cairo_get_current_point(v.native(), (*C.double)(&x), (*C.double)(&y))
	return
}
Beispiel #3
0
// void cairo_get_current_point (cairo_t *cr, double *x, double *y);
func (self *Surface) GetCurrentPoint(x, y float64) (float64, float64) {
	C.cairo_get_current_point(self.context, (*C.double)(unsafe.Pointer(&x)), (*C.double)(unsafe.Pointer(&y)))
	return x, y
}