Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/matplotlib/tri/_tri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ int Triangulation::get_triangle_point(const TriEdge& tri_edge) const
bool Triangulation::is_masked(int tri) const
{
assert(tri >= 0 && tri < get_ntri() && "Triangle index out of bounds.");
return !_mask.empty() && _mask(tri);
const npy_bool* mask_ptr = reinterpret_cast<const npy_bool*>(_mask.data());
return !_mask.empty() && mask_ptr[tri];
}

void Triangulation::set_mask(const MaskArray& mask)
Expand Down
6 changes: 6 additions & 0 deletions src/numpy_cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,12 @@ class array_view : public detail::array_view_accessors<array_view, T, ND>
return size() == 0;
}

// Do not use this for array_view<bool, ND>. See comment near top of file.
const T *data() const
{
return (const T *)m_data;
}

// Do not use this for array_view<bool, ND>. See comment near top of file.
T *data()
{
Expand Down