Sat, 08 Feb 2020 00:08:57 +0200
avoid having the null id in the selection
src/ui/canvas.cpp | file | annotate | diff | comparison | revisions |
--- a/src/ui/canvas.cpp Fri Feb 07 23:59:06 2020 +0200 +++ b/src/ui/canvas.cpp Sat Feb 08 00:08:57 2020 +0200 @@ -13,6 +13,7 @@ void Canvas::handleSelectionChange(const QSet<ldraw::Id>& selectedIds, const QSet<ldraw::Id>& deselectedIds) { + Q_ASSERT(not selectedIds.contains(ldraw::NULL_ID)); this->selection.subtract(deselectedIds); this->selection.unite(selectedIds); this->compiler->setSelectedObjects(this->selection); @@ -40,7 +41,14 @@ { if (this->totalMouseMove < (2.0 / sqrt(2)) * 5.0) { - this->selection = {this->highlighted}; + if (this->highlighted == ldraw::NULL_ID) + { + this->selection = {}; + } + else + { + this->selection = {this->highlighted}; + } this->compiler->setSelectedObjects(this->selection); emit selectionChanged(this->selection); this->update();