Cleanup: use float2, int2 types for cursor drawing callbacks
Ref !138172
This commit is contained in:
@@ -80,8 +80,10 @@ static PyObject *PyC_Tuple_CopySized(PyObject *src, int len_dst)
|
||||
return dst;
|
||||
}
|
||||
|
||||
static void cb_wm_cursor_draw(
|
||||
bContext *C, int x, int y, float /*x_tilt*/, float /*y_tilt*/, void *customdata)
|
||||
static void cb_wm_cursor_draw(bContext *C,
|
||||
const blender::int2 &xy,
|
||||
const blender::float2 & /*tilt*/,
|
||||
void *customdata)
|
||||
{
|
||||
PyGILState_STATE gilstate;
|
||||
bpy_context_set(C, &gilstate);
|
||||
@@ -93,7 +95,7 @@ static void cb_wm_cursor_draw(
|
||||
const int cb_args_len = PyTuple_GET_SIZE(cb_args);
|
||||
|
||||
PyObject *cb_args_xy = PyTuple_New(2);
|
||||
PyTuple_SET_ITEMS(cb_args_xy, PyLong_FromLong(x), PyLong_FromLong(y));
|
||||
PyTuple_SET_ITEMS(cb_args_xy, PyLong_FromLong(xy.x), PyLong_FromLong(xy.y));
|
||||
|
||||
PyObject *cb_args_with_xy = PyC_Tuple_CopySized(cb_args, cb_args_len + 1);
|
||||
PyTuple_SET_ITEM(cb_args_with_xy, cb_args_len, cb_args_xy);
|
||||
|
||||
Reference in New Issue
Block a user