push2: vector, not map

This commit is contained in:
Paul Davis
2022-08-27 16:03:01 -06:00
parent 6627d24c2b
commit 06abdb4c4e
3 changed files with 10 additions and 7 deletions

View File

@@ -1906,7 +1906,9 @@ Push2::set_pressure_mode (PressureMode pm)
boost::shared_ptr<Push2::Pad>
Push2::pad_by_xy (int x, int y)
{
Push2::PadMap::iterator p = _xy_pad_map.find ((x * 8) +y);
assert (p != _xy_pad_map.end());
return p->second;
vector<boost::shared_ptr<Pad> >::size_type index = (x * 8) + y;
if (index >= _xy_pad_map.size()) {
return boost::shared_ptr<Pad>();
}
return _xy_pad_map[index];
}