| 357 | } |
| 358 | |
| 359 | void Polygon::setPositionFromCentroid(const Transform::UnitVector& position) |
| 360 | { |
| 361 | if (!m_points.empty()) |
| 362 | { |
| 363 | const Transform::UnitVector pVec |
| 364 | = position.to<Transform::Units::SceneUnits>(); |
| 365 | const Transform::UnitVector centroid = this->getCentroid(); |
| 366 | const Transform::UnitVector addPosition = pVec - centroid; |
| 367 | |
| 368 | for (auto& point : m_points) |
| 369 | { |
| 370 | *point += addPosition; |
| 371 | } |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | PolygonPoint& Polygon::operator[](point_index_t i) |
| 376 | { |
nothing calls this directly
no test coverage detected