| 96 | } |
| 97 | |
| 98 | void Polygon::setPointPosition( |
| 99 | std::size_t index, const Transform::UnitVector& position) |
| 100 | { |
| 101 | const Transform::UnitVector pixelPosition |
| 102 | = position.to<Transform::Units::ScenePixels>(); |
| 103 | if (shape.getPointCount() <= index) |
| 104 | { |
| 105 | shape.setPointCount(index + 1); |
| 106 | } |
| 107 | shape.setPoint(index, sf::Vector2f(pixelPosition.x, pixelPosition.y)); |
| 108 | } |
| 109 | |
| 110 | Transform::UnitVector Polygon::getPointPosition(std::size_t index) const |
| 111 | { |