Drawing lines with libart



Hi,

In the latest of my long succession of libart questions: how does 
art_svp_vpath_stroke work?  This code, which I think should work, doesn't
draw anything, which is a little frustrating.  x0 < x1 and y0 < y1 in all
cases.  MITER_LIMIT is 4, and FLATNESS is 0.25 (what are these?).  width
is 1.

	vpath[0].code = ART_MOVETO; vpath[0].x = x1; vpath[0].y = y1;
	vpath[1].code = ART_LINETO; vpath[1].x = x0; vpath[1].y = y0;
	vpath[2].code = ART_END; vpath[2].x = 0; vpath[2].y = 0;

	if (dev->linewidth < 0.5)
	    width = 0.5;

	line_svp = art_svp_vpath_stroke (vpath,
					 ART_PATH_STROKE_JOIN_MITER,
					 ART_PATH_STROKE_CAP_BUTT,
					 width, MITER_LIMIT, FLATNESS);
	art_rgb_svp_alpha (line_svp, 0, 0, dev->width, dev->height,
			   dev->outline_color, dev->buf, dev->rowstride, NULL);
	art_svp_free (line_svp);

-- 
Lyndon Drake                       | Desktop:      http://www.gnome.org
isenguard                          | Mail client:  http://www.mutt.org
ICQ#: 12558803                     | Editor:       http://www.vim.org
http://stat.auckland.ac.nz/~lyndon | OS:           http://www.linux.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]