[Image-SIG] Aggdraw: curveto()
Fredrik Lundh
fredrik at pythonware.com
Wed Sep 24 20:44:57 CEST 2008
Yanone wrote:
> it seems that this is a known problem: the curveto() function of aggdraw
> draws straight lines instead of curves, ignoring the given bezier
> control points. the last post i found about this dates back to march
> 2006, and even the developer version of aggdraw via svn didn't change this.
> if i could code in C i would have a look at it myself, but i'm helpless.
>
> could this somehow be solved?
here's a workaround, at least: replace the path_close implementation
with the following:
static PyObject*
path_close(PathObject* self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ":close"))
return NULL;
self->path->close_polygon();
/* expand curves */
agg::path_storage* path = self->path;
agg::conv_curve<agg::path_storage> curve(*path);
self->path = new agg::path_storage();
self->path->add_path(curve, 0, false);
delete path;
Py_INCREF(Py_None);
return Py_None;
}
(not sure this is the best way to fix this, but it should hopefully get
you going)
</F>
More information about the Image-SIG
mailing list