diff --git a/src/_path_wrapper.cpp b/src/_path_wrapper.cpp index 40b5abb2fd37..2b58aec0cfdd 100644 --- a/src/_path_wrapper.cpp +++ b/src/_path_wrapper.cpp @@ -471,17 +471,19 @@ static PyObject *Py_affine_transform(PyObject *self, PyObject *args, PyObject *k if (PyArray_NDIM(vertices_arr) == 2) { numpy::array_view vertices(vertices_arr); + Py_DECREF(vertices_arr); + npy_intp dims[] = { (npy_intp)vertices.size(), 2 }; numpy::array_view result(dims); CALL_CPP("affine_transform", (affine_transform_2d(vertices, trans, result))); - Py_DECREF(vertices_arr); return result.pyobj(); } else { // PyArray_NDIM(vertices_arr) == 1 numpy::array_view vertices(vertices_arr); + Py_DECREF(vertices_arr); + npy_intp dims[] = { (npy_intp)vertices.size() }; numpy::array_view result(dims); CALL_CPP("affine_transform", (affine_transform_1d(vertices, trans, result))); - Py_DECREF(vertices_arr); return result.pyobj(); } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy