src/document.cpp

changeset 188
64ea7282611e
parent 187
30204975694a
child 191
d355d4c52d51
--- a/src/document.cpp	Mon May 16 01:40:49 2022 +0300
+++ b/src/document.cpp	Tue May 24 16:11:10 2022 +0300
@@ -167,7 +167,7 @@
 	this->tools.push_back(new CircleTool{this});
 	this->tools.push_back(new PathTool{this});
 	this->tools.push_back(new TransformTool{this});
-	for (BaseTool* const toolInstance : this->tools)
+	for (BaseTool* toolInstance : this->tools)
 	{
 		QAction* action = new QAction{toolInstance->name(), this};
 		action->setCheckable(true);
@@ -185,6 +185,7 @@
 		{
 			this->ui.toolWidgetStack->addWidget(new QWidget{this});
 		}
+		connect(toolInstance, &BaseTool::desiredGridChange, this->renderer, &Canvas::setGridMatrix);
 	}
 	this->selectTool(this->tools[0]);
 }
@@ -240,6 +241,11 @@
 	this->renderer->adjustGridToView();
 }
 
+const glm::mat4 &Document::currentGrid() const
+{
+	return this->renderer->getGridMatrix();
+}
+
 const Model &Document::getModel() const
 {
 	return *this->model;

mercurial