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) |