diff -r e628fc2e0c72 -r 03f8e6d42e13 src/tools/drawtool.cpp --- a/src/tools/drawtool.cpp Thu Mar 03 21:13:16 2022 +0200 +++ b/src/tools/drawtool.cpp Fri Mar 04 11:37:50 2022 +0200 @@ -12,8 +12,10 @@ static const QBrush polygonBrush = {QColor{64, 255, 128, 192}}; static const QBrush badPolygonBrush = {QColor{255, 96, 96, 192}}; -DrawTool::DrawTool(Model *model, QWidget *parent) : - BaseTool{model, parent} {} +DrawTool::DrawTool(Document* document) : + BaseTool{document} +{ +} QString DrawTool::name() const { @@ -142,17 +144,17 @@ { if (this->polygon.size() >= 2 and this->polygon.size() <= 4) { - Model::EditContext edit = document->editModel(); + std::unique_ptr modelEditor = document->editModel(); switch (this->polygon.size()) { case 2: - edit.append(vectorToArray<2>(this->polygon), ldraw::EDGE_COLOR); + modelEditor->append(vectorToArray<2>(this->polygon), ldraw::EDGE_COLOR); break; case 3: - edit.append(vectorToArray<3>(this->polygon), ldraw::MAIN_COLOR); + modelEditor->append(vectorToArray<3>(this->polygon), ldraw::MAIN_COLOR); break; case 4: - edit.append(vectorToArray<4>(this->polygon), ldraw::MAIN_COLOR); + modelEditor->append(vectorToArray<4>(this->polygon), ldraw::MAIN_COLOR); break; } }