Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cells.find(cell =>
isCursorInRect(
cell.x + origin.x + margin.left,
cell.y + origin.y + margin.top,
cellSize,
cellSize,
x,
y
)
)
const node = this.nodes.find(node =>
isCursorInRect(
node.x + margin.left + offsetX - node.width / 2,
node.y + margin.top + offsetY - node.height / 2,
node.width,
node.height,
x,
y
)
)
cells.find(cell =>
isCursorInRect(
cell.x + origin.x + margin.left,
cell.y + origin.y + margin.top,
cellSize,
cellSize,
x,
y
)
)
nodes.find(node =>
isCursorInRect(
node.x + margin.left - node.size / 2,
node.y + margin.top - node.size / 2,
node.size,
node.size,
x,
y
)
)
nodes.find(node =>
isCursorInRect(node.x + margin.left, node.y + margin.top, node.width, node.height, x, y)
)
event => {
const [x, y] = getRelativeCursor(canvasEl.current, event)
if (!isCursorInRect(margin.left, margin.top, innerWidth, innerHeight, x, y))
return null
const nodeIndex = delaunay.find(x - margin.left, y - margin.top)
return nodes[nodeIndex]
},
[canvasEl, margin, innerWidth, innerHeight, delaunay]
nodes.find(node =>
isCursorInRect(node.x + margin.left, node.y + margin.top, node.width, node.height, x, y)
)
event => {
const [x, y] = getRelativeCursor(canvasEl.current, event)
if (!isCursorInRect(margin.left, margin.top, innerWidth, innerHeight, x, y)) return null
const nodeIndex = delaunay.find(x - margin.left, y - margin.top)
return nodes[nodeIndex]
},
[canvasEl, margin, innerWidth, innerHeight, delaunay]