view_rtree: Map maximum BBOX2I onto maximum rtree

When re-drawing or re-caching all items, we need to search the full
rtree, including for those items that live outside of the limits of
BBOX2I.  This forces the maximum BBOX2I to the full RTree limits
This commit is contained in:
Seth Hillbrand 2019-02-15 09:12:51 -08:00
parent 24185f45f2
commit 7b60c856e9
1 changed files with 15 additions and 2 deletions

View File

@ -79,8 +79,21 @@ public:
template <class Visitor>
void Query( const BOX2I& aBounds, Visitor& aVisitor ) // const
{
const int mmin[2] = { aBounds.GetX(), aBounds.GetY() };
const int mmax[2] = { aBounds.GetRight(), aBounds.GetBottom() };
int mmin[2] = { aBounds.GetX(), aBounds.GetY() };
int mmax[2] = { aBounds.GetRight(), aBounds.GetBottom() };
// We frequently use the maximum bounding box to recache all items
// or for any item that overflows the integer width limits of BBOX2I
// in this case, we search the full rtree whose bounds are absolute
// coordinates rather than relative
BOX2I max_box;
max_box.SetMaximum();
if( aBounds == max_box )
{
mmin[0] = mmin[1] = INT_MIN;
mmax[0] = mmax[1] = INT_MAX;
}
VIEW_RTREE_BASE::Search( mmin, mmax, aVisitor );
}