src/ui/canvas.cpp

changeset 110
d922431eacf7
parent 109
40a1cf2f38f5
child 111
1f42c03fafca
equal deleted inserted replaced
109:40a1cf2f38f5 110:d922431eacf7
245 points2d.push_back(this->modelToScreenCoordinates(point)); 245 points2d.push_back(this->modelToScreenCoordinates(point));
246 } 246 }
247 painter->drawPolygon(QPolygonF{points2d}); 247 painter->drawPolygon(QPolygonF{points2d});
248 } 248 }
249 249
250 const std::optional<glm::vec3>& Canvas::getWorldPosition() const
251 {
252 return this->worldPosition;
253 }
254
250 void Canvas::drawWorldPoint(QPainter* painter, const glm::vec3& worldPoint) const 255 void Canvas::drawWorldPoint(QPainter* painter, const glm::vec3& worldPoint) const
251 { 256 {
252 const QPointF center = this->modelToScreenCoordinates(worldPoint); 257 const QPointF center = this->modelToScreenCoordinates(worldPoint);
253 painter->drawEllipse(geom::inscribe(geom::CircleF{center, 5})); 258 painter->drawEllipse(geom::inscribe(geom::CircleF{center, 5}));
254 } 259 }

mercurial