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
|
|
|
|
|
|
|
|
2019-12-12 22:25:39 +00:00
|
|
|
export default function LoggingCroppingConnectionDocking(injector) {
|
|
|
|
injector.invoke(CroppingConnectionDocking, this);
|
2017-12-12 22:40:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LoggingCroppingConnectionDocking.$inject = [
|
2019-12-12 22:25:39 +00:00
|
|
|
'injector'
|
2017-12-12 22:40:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|