fix off-by-one in boundary check

This commit is contained in:
Djairo Hougee 2024-05-07 17:09:09 +02:00
parent 0c08176386
commit f57562a14d
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ void LGlyphLayer::updateData(int t) {
if (beachedFor < this->beachedAtNumberOfTimes) {
this->points->GetPoint(n, point);
// second check: only update points within our grid's boundary.
if (point[0] < this->uvGrid->lonMin() or point[0] > this->uvGrid->lonMax() or point[1] < this->uvGrid->latMin() or point[1] > this->uvGrid->latMax()) {
if (point[0] <= this->uvGrid->lonMin() or point[0] >= this->uvGrid->lonMax() or point[1] <= this->uvGrid->latMin() or point[1] >= this->uvGrid->latMax()) {
// sets any particle out of bounds to be beached - so it gets assigned the right colour in the lookup table.
this->particlesBeached->SetValue(n, this->beachedAtNumberOfTimes);
continue;