Skip to content

Improve the GetClosestSide method of the Rectangle class

Michele Polese requested to merge mychele/ns-3-dev:fix-rectangle into master

The current implementation of the GetClosestSide method in the Rectangle class works only if the position that is being tested is inside the rectangle. This is however not checked or specified in the documentation. In the first commit of this MR, I added an assert and edited the documentation to make this clear. In the second commit, I provide the implementation of a method that also works for positions outside the rectangle. TBD whether it is of interest or not to have a method (i.e., GetClosestSide) that works for both inside and outside positions.

Edited by Tom Henderson

Merge request reports