Improvement #1806
open
function getIOPositions(origin, destination) {
const originX1 = origin.x;
const originX2 = origin.x + origin.width;
const destinationX1 = destination.x;
const destinationX2 = destination.x + destination.width;
let originIO = {
x: originX1,
y: origin.y + origin.height / 2,
};
if(Math.abs(originX1 - destinationX1) > Math.abs(originX2 - destinationX1)) {
originIO.x = originX2;
}
let destinationIO = {
x: destinationX1,
y: destination.y + destination.height / 2,
};
if(Math.abs(originX1 - destinationX1) > Math.abs(originX1 - destinationX2)) {
destinationIO.x = destinationX2;
}
return {
origin: originIO,
destination: destinationIO,
};
}
- Subject changed from Make getGridDistance() smarter to Make resources path smarter
- Description updated (diff)
Also available in: Atom
PDF