plugins/routers/joint.routers.manhattan.js
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);
    }
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);
    }
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 ) ; }
return a clone of point snapped to grid
return a clone of point snapped to grid