protected void defineSmallRectangles ( ZoomableGraphicsContext gc , T element ) { final double ptsSize = element . getPointSize ( ) / 2. ; final Rectangle2afp < ? , ? , ? , ? , ? , ? > visibleArea = gc . getVisibleArea ( ) ; for ( final Point2d point : element . points ( ) ) { if ( visibleArea . contains ( point ) ) { final double x = point . getX ( ) - ptsSize ; final double y = point . getY ( ) - ptsSize ; final double mx = point . getX ( ) + ptsSize ; final double my = point . getY ( ) + ptsSize ; gc . moveTo ( x , y ) ; gc . lineTo ( mx , y ) ; gc . lineTo ( mx , my ) ; gc . lineTo ( x , my ) ; gc . closePath ( ) ; } } }
Define a path that corresponds to the small rectangles around the points .