src/mainwindow.cpp

changeset 109
40a1cf2f38f5
parent 108
94c92c923713
child 111
1f42c03fafca
--- a/src/mainwindow.cpp	Sun Jul 25 13:49:37 2021 +0300
+++ b/src/mainwindow.cpp	Sun Jul 25 16:26:38 2021 +0300
@@ -214,6 +214,13 @@
 	connect(document, &Document::splitterChanged, this, &MainWindow::handleDocumentSplitterChange);
 	connect(document, &Document::mouseClick, this, &MainWindow::canvasMouseReleased);
 	connect(document, &Document::mouseMove, this, &MainWindow::canvasMouseMoved);
+	document->setCanvasOverpaintCallback([&](Canvas* canvas, QPainter* painter)
+	{
+		if (this->selectedTool != nullptr)
+		{
+			this->selectedTool->overpaint(canvas, painter);
+		}
+	});
 }
 
 void MainWindow::runSettingsEditor()

mercurial