Skip to content

Commit

Permalink
Merge pull request OpenChemistry#1157 from ghutchis/fix-editor
Browse files Browse the repository at this point in the history
Fix editor smooth drag
  • Loading branch information
ghutchis authored Aug 29, 2022
2 parents 10edf92 + 6c47757 commit 49a75e3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions avogadro/qtplugins/editor/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,9 @@ void Editor::atomLeftDrag(QMouseEvent* e)
}
}

if (atomToBond.isValid()) {
if (atomToBond.isValid() && (atomToBond.index != m_newObject.index)) {
// If we have a newAtom, destroy it
if (m_newObject.isValid() && atomToBond.index != m_newObject.index &&
m_newObject.type == Rendering::AtomType) {
if (m_newObject.isValid() && m_newObject.type == Rendering::AtomType) {
m_molecule->removeAtom(m_newObject.index);
changes |= Molecule::Atoms | Molecule::Bonds | Molecule::Removed;
m_newObject = Identifier();
Expand Down

0 comments on commit 49a75e3

Please sign in to comment.