diff -r 128efb9d148b -r 02f142b399b1 src/ui/canvas.cpp --- a/src/ui/canvas.cpp Tue Jul 20 01:22:01 2021 +0300 +++ b/src/ui/canvas.cpp Sat Jul 24 01:50:38 2021 +0300 @@ -91,17 +91,6 @@ { if (this->totalMouseMove < (2.0 / sqrt(2)) * 5.0) { - if (this->highlighted == ldraw::NULL_ID) - { - this->selection = {}; - } - else - { - this->selection = {this->highlighted}; - } - this->compiler->setSelectedObjects(this->selection); - emit selectionChanged(this->selection); - this->update(); MouseClickInfo info; info.worldPosition = this->worldPosition; info.invoker = this; @@ -297,3 +286,19 @@ { return previewLayers[static_cast(name)]; } + +void Canvas::clearSelection() +{ + this->selection.clear(); + this->compiler->setSelectedObjects(this->selection); + emit selectionChanged(this->selection); + this->update(); +} + +void Canvas::addToSelection(ldraw::id_t id) +{ + this->selection.insert(id); + this->compiler->setSelectedObjects(this->selection); + emit selectionChanged(this->selection); + this->update(); +}