From c796bca92f96fa2891775f13294b8732354d2a82 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 24 Aug 2008 16:31:35 +0000 Subject: [PATCH] Fix method format string, so the method is actual callable in a script. 2008-08-24 Lars-Peter Clausen * plug-ins/pygimp/pygimp-drawable.c (drw_transform_rotate, drw_transform_flip_simple): Fix method format string, so the method is actual callable in a script. svn path=/trunk/; revision=26744 --- ChangeLog | 6 ++++++ plug-ins/pygimp/pygimp-drawable.c | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20330c5a8d..58093f9f9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-24 Lars-Peter Clausen + + * plug-ins/pygimp/pygimp-drawable.c (drw_transform_rotate, + drw_transform_flip_simple): Fix method format string, so the + method is actual callable in a script. + 2008-08-24 Martin Nordholts * app/tools/gimplevelstool.c (gimp_levels_tool_dialog): Set diff --git a/plug-ins/pygimp/pygimp-drawable.c b/plug-ins/pygimp/pygimp-drawable.c index 68a4f0ad25..21168467ed 100644 --- a/plug-ins/pygimp/pygimp-drawable.c +++ b/plug-ins/pygimp/pygimp-drawable.c @@ -131,6 +131,12 @@ drw_get_tile(PyGimpDrawable *self, PyObject *args, PyObject *kwargs) ensure_drawable(self); + if(row < 0 || row >= self->drawable->ntile_rows || + col < 0 || col >= self->drawable->ntile_cols) { + Py_INCREF(Py_None); + return Py_None; + } + t = gimp_drawable_get_tile(self->drawable, shadow, row, col); return pygimp_tile_new(t, self); } @@ -148,6 +154,11 @@ drw_get_tile2(PyGimpDrawable *self, PyObject *args, PyObject *kwargs) return NULL; ensure_drawable(self); + if(x < 0 || x >= self->drawable->width || + y < 0 || y >= self->drawable->height) { + Py_INCREF(Py_None); + return Py_None; + } t = gimp_drawable_get_tile2(self->drawable, shadow, x, y); return pygimp_tile_new(t, self); @@ -474,7 +485,7 @@ drw_transform_flip_simple(PyGimpDrawable *self, PyObject *args, PyObject *kwargs "clip_result", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "iid|:transform_flip_simple", kwlist, + "iid|i:transform_flip_simple", kwlist, &flip_type, &auto_center, &axis, &clip_result)) return NULL; @@ -578,7 +589,7 @@ drw_transform_rotate(PyGimpDrawable *self, PyObject *args, PyObject *kwargs) "clip_result", NULL }; if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "diiii|iii:transform_rotate", kwlist, + "diiiii|iii:transform_rotate", kwlist, &angle, &auto_center, ¢er_x, ¢er_y, &transform_direction, &interpolation, &supersample, &recursion_level,