dist/joint.nowrap.js
function modelCenter(view, magnet) {

        var model = view.model;
        var bbox = model.getBBox();
        var center = bbox.center();
        var angle = model.angle();

        var portId = view.findAttribute('port', magnet);
        if (portId) {
            var portGroup = model.portProp(portId, 'group');
            var portsPositions = model.getPortsPositions(portGroup);
            var anchor = new g.Point(portsPositions[portId]).offset(bbox.origin());
            anchor.rotate(center, -angle);
            return anchor;
        }

        return center;
    }
function modelCenter(view, magnet) {

        var model = view.model;
        var bbox = model.getBBox();
        var center = bbox.center();
        var angle = model.angle();

        var portId = view.findAttribute('port', magnet);
        if (portId) {
            var portGroup = model.portProp(portId, 'group');
            var portsPositions = model.getPortsPositions(portGroup);
            var anchor = new g.Point(portsPositions[portId]).offset(bbox.origin());
            anchor.rotate(center, -angle);
            return anchor;
        }

        return center;
    }
function modelCenter ( view , magnet ) { var model = view . model ; var bbox = model . getBBox ( ) ; var center = bbox . center ( ) ; var angle = model . angle ( ) ; var portId = view . findAttribute ( 'port' , magnet ) ; if ( portId ) { var portGroup = model . portProp ( portId , 'group' ) ; var portsPositions = model . getPortsPositions ( portGroup ) ; var anchor = new g . Point ( portsPositions [ portId ] ) . offset ( bbox . origin ( ) ) ; anchor . rotate ( center , - angle ) ; return anchor ; } return center ; }
Can find anchor from model, when there is no selector or the link end is connected to a port
Can find anchor from model when there is no selector or the link end is connected to a port