servo / euclid

Geometry primitives (basic linear algebra) for Rust
Other
462 stars 102 forks source link

Return true in the presence of NaN in is_empty_or_negative. #444

Closed nical closed 4 years ago

nical commented 4 years ago

Fixes #443 in which rect intersections don't behave as expected if there is a NaN (is_empty_or_negative returned false causing us to return broken intersection rect). Beyond intersections, we use is_empty_or_negative to differentiate between rects with positive non-zero area and everything else which we treat as empty or invalid-in-the-sense-that-it-doesnt-contribute-to-rendering rectangles. NaN should be part of this cathegory.

for euclid 0.21 I plan to remove is_empty_or_negative and simply implement is_empty everywhere with the semantics of "every thing that is not a valid non-zero area rectangle" since that's what's useful. It's a breaking unfortunately but there's a number them motivating a 0.21 bump.

See also https://bugzilla.mozilla.org/show_bug.cgi?id=1650990

jrmuizel commented 4 years ago

@bors-servo r+

bors-servo commented 4 years ago

:pushpin: Commit ee84a6e has been approved by jrmuizel

bors-servo commented 4 years ago

:hourglass: Testing commit ee84a6e5fed1aadddc0f1f7953d7300e2d715615 with merge 0f3ab76a51dfbcbef497e56bd3b9ccdd176db033...

bors-servo commented 4 years ago

:sunny: Test successful - checks-travis Approved by: jrmuizel Pushing 0f3ab76a51dfbcbef497e56bd3b9ccdd176db033 to master...