PlaceholderParser: fixed reporting of x value outside

of the interpolated table.
This commit is contained in:
Vojtech Bubnik 2023-05-09 11:14:36 +02:00
parent 84db6356b3
commit c9f449bcb2

View File

@ -1644,9 +1644,9 @@ namespace client
}
if (! evaluated) {
// Clamp x into the table range with EPSILON.
if (x > table.table.front().x - EPSILON)
if (double x0 = table.table.front().x; x > x0 - EPSILON && x < x0)
out.set_d(table.table.front().y);
else if (x < table.table.back().x + EPSILON)
else if (double x1 = table.table.back().x; x > x1 && x < x1 + EPSILON)
out.set_d(table.table.back().y);
else
// The value is really outside the table range.