@@ -1145,7 +1145,7 @@ class QuadMeshGenerator {
1145
1145
inline unsigned vertex (unsigned idx, double * x, double * y) {
1146
1146
size_t m = (idx & 0x2 ) ? (m_m + 1 ) : m_m;
1147
1147
size_t n = (idx+1 & 0x2 ) ? (m_n + 1 ) : m_n;
1148
- double * pair = (double *)PyArray_GETPTR2 (m_coordinates, m, n );
1148
+ double * pair = (double *)PyArray_GETPTR2 (m_coordinates, n, m );
1149
1149
*x = *pair++;
1150
1150
*y = *pair;
1151
1151
return (idx) ? agg::path_cmd_line_to : agg::path_cmd_move_to;
@@ -1172,7 +1172,7 @@ class QuadMeshGenerator {
1172
1172
1173
1173
inline QuadMeshGenerator (size_t meshWidth, size_t meshHeight, const Py::Object& coordinates) :
1174
1174
m_meshWidth(meshWidth), m_meshHeight(meshHeight), m_coordinates(NULL ) {
1175
- PyArrayObject* coordinates_array = (PyArrayObject*)PyArray_FromObject (coordinates.ptr (), PyArray_DOUBLE, 1 , 3 );
1175
+ PyArrayObject* coordinates_array = (PyArrayObject*)PyArray_FromObject (coordinates.ptr (), PyArray_DOUBLE, 3 , 3 );
1176
1176
if (!coordinates_array) {
1177
1177
throw Py::ValueError (" Invalid coordinates array." );
1178
1178
}
@@ -1189,7 +1189,7 @@ class QuadMeshGenerator {
1189
1189
}
1190
1190
1191
1191
inline path_iterator operator ()(size_t i) const {
1192
- return QuadMeshPathIterator (i % m_meshHeight , i / m_meshHeight , m_coordinates);
1192
+ return QuadMeshPathIterator (i % m_meshWidth , i / m_meshWidth , m_coordinates);
1193
1193
}
1194
1194
};
1195
1195
0 commit comments