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

Skip to content

Commit eb05076

Browse files
committed
Update to use new numpy macros.
svn path=/branches/transforms/; revision=4284
1 parent a6333af commit eb05076

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/agg_py_path_iterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PathIterator {
2020

2121
m_vertices = (PyArrayObject*)PyArray_FromObject
2222
(vertices_obj.ptr(), PyArray_DOUBLE, 2, 2);
23-
if (!m_vertices || m_vertices->nd != 2 || m_vertices->dimensions[1] != 2)
23+
if (!m_vertices || PyArray_NDIM(m_vertices) != 2 || PyArray_DIM(m_vertices, 1) != 2)
2424
throw Py::ValueError("Invalid vertices array.");
2525

2626
if (codes_obj.ptr() != Py_None) {

src/agg_py_transforms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ bool py_convert_bbox(PyObject* bbox_obj, double& l, double& b, double& r, double
6363
try {
6464
bbox = (PyArrayObject*) PyArray_FromObject(bbox_obj, PyArray_DOUBLE, 2, 2);
6565

66-
if (!bbox || bbox->nd != 2 || bbox->dimensions[0] != 2 || bbox->dimensions[1] != 2) {
66+
if (!bbox || PyArray_NDIM(bbox) != 2 || PyArray_DIM(bbox, 0) != 2 || PyArray_DIM(bbox, 1) != 2) {
6767
throw Py::TypeError
6868
("Argument 3 to agg_to_gtk_drawable must be a Bbox object.");
6969
}

0 commit comments

Comments
 (0)