Closed OfficerYoda closed 2 weeks ago
When an object is lying on the edge between two nodes it will only be inserted into one. It prefers the nodes in the following order: top left --> top right --> bottom left --> bottom right with it mostly preffering the top left.
It was caused by wrong ordering in of two boolean values. Before:
successfullyInserted = successfullyInserted || child!!.insert(obj)
After:
successfullyInserted = child!!.insert(obj) || successfullyInserted
When an object is lying on the edge between two nodes it will only be inserted into one. It prefers the nodes in the following order: top left --> top right --> bottom left --> bottom right with it mostly preffering the top left.