question: @ Override public Point2D . Double constrainPoint ( Point2D . Double p ) { p . x = Math . round ( p . x / width ) * width ; p . y = Math . round ( p . y / height ) * height ; return p ; }
target:  Constrains a point to the closest grid point in any direction.