Fix "is integral" check in QGeoCameraTilesPrivate::tilesFromPolygon
The boolean variable is called xIntegral, likely indicating whether
the FP value x is close enough to the integral value. However, the
code executed the same
qFuzzyCompare(val, std::floor(val))
check for both val == x and val == x + 1. Presumably, the check for
x + 1 was included to address the limitation of qFuzzyCompare(),
which can yield incorrect results when the values are close to zero.
Using std::floor() is incorrect because it only returns valid
results when val is slightly larger than int(val). It provides
incorrect results if val is slightly smaller.
This commit fixes both issues by using qFuzzyIsNull() for the "== 0"
case and replacing std::floor() with std::round().
The same changes should be applied to the y-coordinate.
Since the git history does not reliably indicate why this check was
implemented or what was originally intended, do not backport this
change to older branches.
Task-number: QTBUG-144282
Change-Id: Ia3467ef395ff20fb7c2d3c67f4271d3f41810269
Reviewed-by: Marc Mutz <marc.mutz@qt.io>