Skip to content

Commit

Permalink
Fix spurious "change layer" bug with the selection tool
Browse files Browse the repository at this point in the history
Fix OpenChemistry#1206 - layer is not created by default
Fix OpenChemistry#1192 - layer is not changed, avoiding a crash

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
  • Loading branch information
ghutchis committed Oct 25, 2023
1 parent 3c58251 commit a0c5053
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion avogadro/qtplugins/selectiontool/selectiontoolwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ void SelectionToolWidget::setDropDown(size_t current, size_t max)
m_ui->changeLayerDropDown->addItem(QString::number(i + 1));
}
m_ui->changeLayerDropDown->addItem(tr("New Layer"));
m_ui->changeLayerDropDown->setCurrentIndex(current);
if (current != m_ui->changeLayerDropDown->currentIndex())
m_ui->changeLayerDropDown->setCurrentIndex(current);
}

void SelectionToolWidget::userClickedColor()
Expand Down

1 comment on commit a0c5053

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: clang-format-diff detected formatting issues. See the artifact for a patch or run clang-format on your branch.

Please sign in to comment.