Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f10f71

Browse files
committed
Fix deprecated api usage in _backend_agg.cpp
1 parent 0ae32cb commit 6f10f71

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/_backend_agg.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -954,9 +954,9 @@ RendererAgg::draw_text_image(const Py::Tuple& args)
954954
"First argument to draw_text_image must be a FT2Font.Image object or a Nx2 uint8 numpy array.");
955955
}
956956
image_obj = Py::Object(image_array, true);
957-
buffer = (unsigned char *)PyArray_DATA(image_array);
958-
width = PyArray_DIM(image_array, 1);
959-
height = PyArray_DIM(image_array, 0);
957+
buffer = (unsigned char *)PyArray_DATA((PyArrayObject*)image_array);
958+
width = PyArray_DIM((PyArrayObject*)image_array, 1);
959+
height = PyArray_DIM((PyArrayObject*)image_array, 0);
960960
}
961961
else
962962
{
@@ -1546,11 +1546,11 @@ RendererAgg::_draw_path_collection_generic
15461546
}
15471547

15481548
size_t Npaths = path_generator.num_paths();
1549-
size_t Noffsets = offsets->dimensions[0];
1549+
size_t Noffsets = PyArray_DIM(offsets, 0);
15501550
size_t N = std::max(Npaths, Noffsets);
1551-
size_t Ntransforms = transforms_arr->dimensions[0];
1552-
size_t Nfacecolors = facecolors->dimensions[0];
1553-
size_t Nedgecolors = edgecolors->dimensions[0];
1551+
size_t Ntransforms = PyArray_DIM(transforms_arr, 0);
1552+
size_t Nfacecolors = PyArray_DIM(facecolors, 0);
1553+
size_t Nedgecolors = PyArray_DIM(edgecolors, 0);
15541554
size_t Nlinewidths = linewidths.length();
15551555
size_t Nlinestyles = std::min(linestyles_obj.length(), N);
15561556
size_t Naa = antialiaseds.length();

0 commit comments

Comments
 (0)