X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpython%2Fgfx.c;h=aaf46ba9cbc6bf42b564c77ee874905d376b05d8;hb=d4aa5c790124fabac817e0fb50cc2c7b2e7fa629;hp=6838974ccfe4667c52c06806db50fd3bf8ab9b53;hpb=b3c5e0c63488daf87888e6ede2a0908215587822;p=swftools.git diff --git a/lib/python/gfx.c b/lib/python/gfx.c index 6838974..aaf46ba 100644 --- a/lib/python/gfx.c +++ b/lib/python/gfx.c @@ -201,10 +201,10 @@ static PyObject*callback_python(char*function, gfxdevice_t*dev, const char*forma PyTuple_SetItem(point, 2, PyFloat_FromDouble(l->y)); } else if(l->type == gfx_splineTo) { point = PyTuple_New(5); - PyTuple_SetItem(point, 0, PyString_FromString("l")); + PyTuple_SetItem(point, 0, PyString_FromString("s")); PyTuple_SetItem(point, 1, PyFloat_FromDouble(l->x)); PyTuple_SetItem(point, 2, PyFloat_FromDouble(l->y)); - PyTuple_SetItem(point, 3, PyFloat_FromDouble(l->sy)); + PyTuple_SetItem(point, 3, PyFloat_FromDouble(l->sx)); PyTuple_SetItem(point, 4, PyFloat_FromDouble(l->sy)); } else { point = PY_NONE; @@ -226,11 +226,14 @@ static PyObject*callback_python(char*function, gfxdevice_t*dev, const char*forma PyErr_Clear(); PyObject* result = PyObject_CallObject(f, tuple); - if(!result) // should we do some error handling here? + if(!result) { + PyErr_Print(); + PyErr_Clear(); return 0; - - Py_DECREF(result); - return 0; + } else { + Py_DECREF(result); + return 0; + } } static int my_setparameter(gfxdevice_t*dev, const char*key, const char*value) @@ -438,7 +441,7 @@ static PyObject* page_asImage(PyObject* _self, PyObject* args, PyObject* kwargs) gfxdevice_t dev1,dev2; gfxdevice_render_init(&dev1); dev1.setparameter(&dev1, "antialise", "2"); - gfxdevice_rescale_init(&dev2, &dev1, width, height); + gfxdevice_rescale_init(&dev2, &dev1, width, height, 0); dev2.startpage(&dev2, self->page->width, self->page->height); self->page->render(self->page, &dev2); dev2.endpage(&dev2);