Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
FloatOrd
for sprite Z comparison and ignore sprites with NaN (#…
…15267) # Objective Fixes #15258 ## Solution If my understanding is correct, sprites with NaN anywhere in their transform won't even get onto the screen, so should not generate pick events. This PR filters sprites with NaN in their transforms before sorting by depth, then uses `FloatOrd` to simplify the comparison. Since we're guaranteed to not have NaN values, it's technically unnecessary, and we could instead sort with `a.partial_cmp(&b).unwrap()`, or even `unwrap_unchecked()`. ## Testing I ran the picking example to ensure Z sorting was working as intended.
- Loading branch information