code: function snapToGrid(point, grid) {
  
          var source = grid.source;
  
          var snappedX = g.snapToGrid(point.x - source.x, grid.x) + source.x;
          var snappedY = g.snapToGrid(point.y - source.y, grid.y) + source.y;
  
          return new g.Point(snappedX, snappedY);
      }
docs: return a clone of point snapped to grid