I'm trying to use google closure to write an application that covers a region of a plane with non-overlapping rectangles. One requirement I have is to be able to take a point on the plane (potentially with any floating-point coordinates) and identify the single rectangle that covers that point. Unfortunately, this has led to a problem using closure's rectangle class.
Consider, for example, the two unit-dimensioned rectangles whose top-left corners are located at (0,0) and (1,1). I would usually consider these rectangles to be non-overlapping, but closure's rectangle class tells me that both contain the point (1,1).
Is there a way I can make closure consider these rectangles to not overlap? Or another way to generate rectangles that do include all possible coordinates but which do not overlap (e.g. a way of specifying that the size of one side of a rectangle is the largest number which is smaller than 1)?