Exemple #1
0
IoObject *IoCairoSurface_getDeviceOffset(IoCairoSurface *self, IoObject *locals, IoMessage *m)
{
	double x = 0, y = 0;

	cairo_surface_get_device_offset(SURFACE(self), &x, &y);
	CHECK_STATUS(self);
	return IoSeq_newWithX_y_(IOSTATE, x, y);
}
Exemple #2
0
IoObject *IoCairoPathElement_pointAt(IoCairoPathElement *self, IoObject *locals, IoMessage *m)
{
	cairo_path_data_t *data = 0;
	int pointCount = 0;
	int i = 0;

	if (!DATA(self)) return IONIL(self);

	i = IoMessage_locals_intArgAt_(m, locals, 0);
	pointCount = IoCairoPathElement_pointCount(self);
	if (i < 0 || i >= pointCount) return IONIL(self);

	data = PATH_DATA(self) + i + 1;
	return IoSeq_newWithX_y_(IOSTATE, data->point.x, data->point.y);
}