From 48dccd5eb0cfc1b77ff53ef1b658b3d37ff92ef1 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Mon, 11 Nov 2024 16:28:22 -0500 Subject: [PATCH] Allow clicking dummy atoms for connecting pieces Signed-off-by: Geoff Hutchison --- avogadro/qtplugins/templatetool/templatetool.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/avogadro/qtplugins/templatetool/templatetool.cpp b/avogadro/qtplugins/templatetool/templatetool.cpp index b8c5e85170..cbc5ddedc4 100644 --- a/avogadro/qtplugins/templatetool/templatetool.cpp +++ b/avogadro/qtplugins/templatetool/templatetool.cpp @@ -449,8 +449,10 @@ Matrix3 applyKabsch(std::vector templatePoints, void TemplateTool::atomLeftClick(QMouseEvent*) { size_t selectedIndex = m_clickedObject.index; + // if it's a valid selected atom and a hydrogen or dummy atom if (m_molecule->atom(selectedIndex).isValid() && - m_molecule->atomicNumber(selectedIndex) == 1) { + (m_molecule->atomicNumber(selectedIndex) == 1 || + m_molecule->atomicNumber(selectedIndex) == 0)) { m_toolWidget->selectedUIDs().push_back( m_molecule->atomUniqueId(selectedIndex)); if (static_cast(m_toolWidget->selectedUIDs().size()) !=