[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Merge: rect optimisation



Can somebody check the code I've proposed for a merge, I believe it is a
more efficient method for checking rect intersection:

https://bitbucket.org/pygame/pygame/pull-request/11/optimise-rect-intersection/diff

The theory is that if (A.topleft < B.bottomright and A.bottomright >
B.topleft) then they must be overlapping. This needs about half the
tests from the current version.

I also wasn't sure where to put "<=" instead of "<" to ensure perfect
backwards compatibility, so it would be great if anybody could point
that out too.

Thanks,
Sam Bull

Attachment: signature.asc
Description: This is a digitally signed message part