399 this->polygon.push_back(*this->worldPosition); |
399 this->polygon.push_back(*this->worldPosition); |
400 } |
400 } |
401 } |
401 } |
402 break; |
402 break; |
403 case CircleMode: |
403 case CircleMode: |
404 if (event->button() == Qt::LeftButton and this->worldPosition.has_value()) { |
404 if (event->button() == Qt::LeftButton) { |
405 if (this->polygon.size() == 3) { |
405 if (this->polygon.size() == 3) { |
406 this->closeShape(); |
406 this->closeShape(); |
407 } |
407 } |
408 else { |
408 else if (this->worldPosition.has_value()) { |
409 this->polygon.push_back(*this->worldPosition); |
409 this->polygon.push_back(*this->worldPosition); |
410 } |
410 } |
411 } |
411 } |
412 break; |
412 break; |
413 } |
413 } |