diff -r 6988973515d2 -r ca23936b455b src/ui/canvas.cpp --- a/src/ui/canvas.cpp Wed May 25 20:36:34 2022 +0300 +++ b/src/ui/canvas.cpp Mon Jun 06 22:01:22 2022 +0300 @@ -1,12 +1,11 @@ #include #include -#include "modeleditor.h" #include "document.h" #include "canvas.h" Canvas::Canvas( Model* model, - Document *document, + EditorTabWidget *document, DocumentManager* documents, const ldraw::ColorTable& colorTable, QWidget* parent) : @@ -21,9 +20,9 @@ * @param selectedIds IDs of objects to select * @param deselectedIds IDs of objects to deselect. */ -void Canvas::handleSelectionChange(const QSet& selectedIds, const QSet& deselectedIds) +void Canvas::handleSelectionChange(const QSet &selectedIds, const QSet &deselectedIds) { - Q_ASSERT(not selectedIds.contains(ldraw::NULL_ID)); + Q_ASSERT(not selectedIds.contains({0})); this->selection.subtract(deselectedIds); this->selection.unite(selectedIds); gl::setModelShaderSelectedObjects(&this->shaders, this->selection); @@ -34,7 +33,7 @@ * @brief Updates vertex rendering * @param document Document to get vertices from */ -void Canvas::rebuildVertices(Document* document) +void Canvas::rebuildVertices(EditorTabWidget* document) { if (this->vertexProgram.has_value()) { @@ -45,7 +44,7 @@ void Canvas::mouseMoveEvent(QMouseEvent* event) { - const ldraw::id_t id = this->pick(event->pos()); + const ModelId id = this->pick(event->pos()); this->highlighted = id; this->totalMouseMove += (event->pos() - this->lastMousePosition).manhattanLength(); this->worldPosition = this->screenToModelCoordinates(event->pos(), this->gridPlane); @@ -339,7 +338,7 @@ /** * @returns the ids of the currently selected objects */ -const QSet Canvas::selectedObjects() const +const QSet Canvas::selectedObjects() const { return this->selection; }