src/tools/drawtool.cpp

changeset 124
f9f308c8e0c5
parent 123
e3fe3617b631
child 125
f127982d3412
--- a/src/tools/drawtool.cpp	Fri Aug 27 14:38:56 2021 +0300
+++ b/src/tools/drawtool.cpp	Sun Aug 29 20:05:24 2021 +0300
@@ -80,6 +80,20 @@
 	return false;
 }
 
+bool DrawTool::keyReleased(QKeyEvent* event)
+{
+	if (event->key() == Qt::Key_Escape)
+	{
+		this->polygon.clear();
+		this->updatePreviewPolygon();
+		return true;
+	}
+	else
+	{
+		return false;
+	}
+}
+
 void DrawTool::updatePreviewPolygon()
 {
 	this->previewPolygon.resize(this->polygon.size() + 1);

mercurial