2018-04-02 19:01:53 +00:00
|
|
|
import CroppingConnectionDocking from 'diagram-js/lib/layout/CroppingConnectionDocking';
|
2017-12-12 22:40:01 +00:00
|
|
|
|
2018-04-02 19:01:53 +00:00
|
|
|
import {
|
|
|
|
getOrientation
|
|
|
|
} from 'diagram-js/lib/layout/LayoutUtil';
|
2017-12-12 22:40:01 +00:00
|
|
|
|
2018-04-02 19:01:53 +00:00
|
|
|
import inherits from 'inherits';
|
2017-12-12 22:40:01 +00:00
|
|
|
|
|
|
|
|
2018-04-02 19:01:53 +00:00
|
|
|
export default function LoggingCroppingConnectionDocking(elementRegistry, graphicsFactory) {
|
2017-12-12 22:40:01 +00:00
|
|
|
CroppingConnectionDocking.call(this, elementRegistry, graphicsFactory);
|
|
|
|
}
|
|
|
|
|
|
|
|
LoggingCroppingConnectionDocking.$inject = [
|
|
|
|
'elementRegistry',
|
|
|
|
'graphicsFactory'
|
|
|
|
];
|
|
|
|
|
|
|
|
inherits(LoggingCroppingConnectionDocking, CroppingConnectionDocking);
|
|
|
|
|
|
|
|
window.noIntersectCount = 0;
|
|
|
|
|
|
|
|
window.noIntersect = [];
|
|
|
|
|
|
|
|
LoggingCroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {
|
|
|
|
|
|
|
|
var intersection = CroppingConnectionDocking.prototype._getIntersection.call(this, shape, connection, takeFirst);
|
|
|
|
|
|
|
|
if (!intersection) {
|
|
|
|
|
|
|
|
if (getOrientation(connection.source, connection.target) !== 'intersect') {
|
|
|
|
window.noIntersectCount++;
|
|
|
|
|
|
|
|
window.noIntersect.push([
|
|
|
|
connection,
|
|
|
|
this._getShapePath(shape),
|
|
|
|
this._getConnectionPath(connection)
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return intersection;
|
|
|
|
};
|