212 }; |
221 }; |
213 |
222 |
214 void EditTools::overpaint(QPainter* painter) |
223 void EditTools::overpaint(QPainter* painter) |
215 { |
224 { |
216 painter->save(); |
225 painter->save(); |
217 const Pens& pens = (this->renderer->isDark() ? darkPens : brightPens); |
226 if (this->usePolygon()) { |
218 this->renderPreview(painter, &pens); |
227 const Pens& pens = (this->renderer->isDark() ? darkPens : brightPens); |
219 QFont font; |
228 this->renderPreview(painter, &pens); |
220 font.setBold(true); |
229 QFont font; |
221 if (this->worldPosition.has_value()) |
230 font.setBold(true); |
222 { |
231 if (this->usePolygon() and this->worldPosition.has_value()) |
223 painter->setRenderHint(QPainter::Antialiasing); |
232 { |
224 painter->setPen(pens.pointPen); |
233 painter->setRenderHint(QPainter::Antialiasing); |
225 painter->setBrush(pens.greenPolygonBrush); |
234 painter->setPen(pens.pointPen); |
226 const QPointF pos = this->renderer->modelToScreenCoordinates(*this->worldPosition); |
235 painter->setBrush(pens.greenPolygonBrush); |
227 painter->drawEllipse(pos, 5, 5); |
236 const QPointF pos = this->renderer->modelToScreenCoordinates(*this->worldPosition); |
228 drawBorderedText(painter, pos + QPointF{5, 5}, font, vectorToString(*this->worldPosition)); |
237 painter->drawEllipse(pos, 5, 5); |
|
238 drawBorderedText(painter, pos + QPointF{5, 5}, font, vectorToString(*this->worldPosition)); |
|
239 } |
229 } |
240 } |
230 painter->restore(); |
241 painter->restore(); |
231 } |
242 } |
232 |
243 |
233 const std::vector<ModelAction> EditTools::modelActions() const |
244 const std::vector<ModelAction> EditTools::modelActions() const |