fix parametrization logic errors when using extremes

This commit is contained in:
Jussi Kuokkanen 2023-09-07 19:00:22 +03:00
parent f9a660afee
commit bbc2e21a51

View File

@ -104,13 +104,13 @@ private:
if (!leftIndex.has_value()) {
// Reading wasn't between points
if (reading > m_points.last().y()) {
if (reading > m_points.last().x()) {
// Use y of rightmost point
emitWithType(m_points.last().y());
return;
} else if (reading < m_points.last().y()) {
} else if (reading < m_points.last().x()) {
// Leftmost
emitWithType(m_points.last().y());
emitWithType(m_points.first().y());
return;
}
}