Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

136
Visualizações
Detect if a node when dropped/moved intersects another node - mxgraph

I am trying to detect if any part of cell node intersects with another cell when u move a cell and some of its body intersects with another node. I tried to write my own custom mouseUp function such that if the there's some intersection, I'll display an error saying that its allowed. Below is the code i wrote. It doesn't work perfectly. one time when it works well is if I put a node on the center on another node but other times when I put a node on the far edge of another node it doesn't work.

const mouseUp = graph.graphHandler.mouseUp;
graph.graphHandler.mouseUp = function(...args) {
      const target = graph.getCellAt(args[1].graphX, args[1].graphY);
      if (target) {
        alert('not allowed');
        graph.graphHandler.reset();
      } else {
        mouseUp.apply(this, args);
      }
    };
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda