Skip to content

Commit

Permalink
python: Fix translate function.
Browse files Browse the repository at this point in the history
  • Loading branch information
igo95862 authored and dankamongmen committed May 16, 2021
1 parent 560c731 commit 935d2db
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions python/notcurses/plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,13 @@ NcPlane_translate(NcPlaneObject *self, PyObject *args, PyObject *kwds)
NcPlaneObject *dst_obj = NULL;
int y = 0, x = 0;

char *keywords[] = {"dst", "y_pos", "x_pos",
char *keywords[] = {"dst",
NULL};

GNU_PY_CHECK_BOOL(PyArg_ParseTupleAndKeywords(args, kwds, "|O!ii", keywords,
&NcPlane_Type, &dst_obj,
&y, &x));

struct ncplane *dst = NULL;
if (NULL != dst_obj)
{
dst = dst_obj->ncplane_ptr;
}
GNU_PY_CHECK_BOOL(PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords,
&NcPlane_Type, &dst_obj));

ncplane_translate(self->ncplane_ptr, dst, &y, &x);
ncplane_translate(self->ncplane_ptr, dst_obj->ncplane_ptr, &y, &x);

return Py_BuildValue("ii", &y, &x);
}
Expand Down

0 comments on commit 935d2db

Please sign in to comment.