First, we note that the set of points that are closer to a particular hexagonal vertex than any other is a triangle with side length $\sqrt3n$, and that six of these triangles meet at the origin. The problem now reduces to finding where a point lies in the following lattice:
* | C |
|\|/|n|
| B | *
|/|m|/|
* | A |
|\|/|p|
| O | *
This lattice is generated by the vectors OA and OB, so write the point in question as a vector sum of them: $p=x\mathsf{OA}+y\mathsf{OB}$. _p_ then lies in the cell $(\lfloor x\rfloor, \lfloor y\rfloor)$ (the cell (0,0) is m above, (1,0) is n, (1,-1) is p and so on).
Within this cell, which will be a translation of OACB in the diagram above, test whether $\operatorname{frac}(x)+\operatorname{frac}(y)<\frac12$. If so, the point in question should be rounded to the centre of the _lower_ triangle in the cell (a translation of OAB); if not, to the centre of the _upper_ triangle (translation of CBA).