Mir

Code review comment for lp:~vanvugt/mir/Rectangle-contains-Rectangle

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> I believe that is acceptable for emptiness to contain emptiness. It certainly doesn't break
> any intended use cases I can think of, or represent any problem in theory. Does it?

I think that for our use cases it may be a bit surprising for an empty rectangle to contain anything at all, but I can't think of a concrete example where this would be a major problem. It just means that all code needs to be ready to handle empty rectangles, even if it's run conditionally after a rect.contains(rect) check.

From a theoretical POV, if an empty rectangle is just the empty set of pixels, then we need (x,y)(0x0) to be contained by any (x',y')(0x0). Right now (x,y)(0x0) only contains itself.

I think we should be consistent by either making empty rectangles not contain anything, or by making all empty rectangles contain all other empty rectangles, although it may not make any difference practically either way.

« Back to merge proposal