src/tools/drawtool.cpp

changeset 124
f9f308c8e0c5
parent 123
e3fe3617b631
child 125
f127982d3412
equal deleted inserted replaced
123:e3fe3617b631 124:f9f308c8e0c5
78 } 78 }
79 } 79 }
80 return false; 80 return false;
81 } 81 }
82 82
83 bool DrawTool::keyReleased(QKeyEvent* event)
84 {
85 if (event->key() == Qt::Key_Escape)
86 {
87 this->polygon.clear();
88 this->updatePreviewPolygon();
89 return true;
90 }
91 else
92 {
93 return false;
94 }
95 }
96
83 void DrawTool::updatePreviewPolygon() 97 void DrawTool::updatePreviewPolygon()
84 { 98 {
85 this->previewPolygon.resize(this->polygon.size() + 1); 99 this->previewPolygon.resize(this->polygon.size() + 1);
86 this->previewPolygon.back() = this->previewPoint; 100 this->previewPolygon.back() = this->previewPoint;
87 if (this->previewPolygon.size() > 2) 101 if (this->previewPolygon.size() > 2)

mercurial