diff -r e3fe3617b631 -r f9f308c8e0c5 src/tools/drawtool.cpp --- 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);