Skip to content

Commit

Permalink
Consider all-NaN as the only "null" rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
strk committed Oct 31, 2023
1 parent 27558c7 commit 06f81ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/geometry/qgsrectangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,8 @@ class CORE_EXPORT QgsRectangle
bool isNull() const
{
// rectangle created QgsRectangle() or with rect.setNull() or
// otherwise having NaN ordinates
return ( std::isnan( mXmin ) && std::isnan( mXmax ) && std::isnan( mYmin ) && std::isnan( mYmax ) ) ||
( qgsDoubleNear( mXmin, std::numeric_limits<double>::max() ) && qgsDoubleNear( mYmin, std::numeric_limits<double>::max() ) &&
qgsDoubleNear( mXmax, -std::numeric_limits<double>::max() ) && qgsDoubleNear( mYmax, -std::numeric_limits<double>::max() ) );
// otherwise having all NaN ordinates
return std::isnan( mXmin ) && std::isnan( mXmax ) && std::isnan( mYmin ) && std::isnan( mYmax );
}

/**
Expand Down

0 comments on commit 06f81ab

Please sign in to comment.