-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
The EMPTY rect should be one in which max is set to MIN and min is set to MAX. In other words, it's a rectangle of infinite negative size.
This is a common practice in many other geometry libraries. The reasoning is simple: an empty rectangle is often used when calculating the union of a series of rectangles (that is, the outer bounds of all of them.). The union of a finite rect A with a negative infinite rect B is just A. So we can start with an empty rect and successively union with each rectangle in turn, using a classic "reduce" or "fold" method.
Note that the EMPTY rect is not the same as a zero-size rect. The rect that is the result of too much negative inflation is not the same as EMPTY because it is still centered at the point of the original rect.
Originally posted by @viridia in #13452 (comment)