# HG changeset patch # User Teemu Piippo # Date 1581113337 -7200 # Node ID eee644f88e93bb7952ccf4960300ffcebab95d03 # Parent 1a9eac27698d8e6068177c877847fbfeb70917af avoid having the null id in the selection diff -r 1a9eac27698d -r eee644f88e93 src/ui/canvas.cpp --- 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& selectedIds, const QSet& 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();