INNER CODE UNIT · JavaScript
dy
Brbb/graphql-rover · js/utils.js:107
var dy = point.y - y;
var w = $("#" + node.customId).attr('width') / 2;
var h = $("#" + node.customId).attr('height') / 2;
var sx = 0,
sy = 0;
if (Math.abs(dy) * w > Math.abs(dx) * h) {
// Intersection is top or bottom of rect.
if (dy < 0) {
h = -h;
}
sx = dy === 0 ? 0 : h * dx / dy;
sy = h;
} else {
// Intersection is left or right of rect.
if (dx < 0) {
w = -w;
}
sx = w;