private void updatePath(float x, float y) {
     closedPath = null;
     if (path == null) {
         path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
         path.moveTo(x, y);
         bounds = new Rectangle2D.Float(x, y, 0, 0);
     } else {
         path.lineTo(x, y);
         float _xmax = (float)bounds.getMaxX();
         float _ymax = (float)bounds.getMaxY();
         float _xmin = (float)bounds.getMinX();
         float _ymin = (float)bounds.getMinY();
         if (x < _xmin) _xmin = x;
         else if (x > _xmax) _xmax = x;
         if (y < _ymin) _ymin = y;
         else if (y > _ymax) _ymax = y;
         bounds = new Rectangle2D.Float(_xmin, _ymin, _xmax - _xmin, _ymax - _ymin);
     }
 }