///////////////////////////////////////////////////////
| 276 | |
| 277 | //////////////////////////////////////////////////////////// |
| 278 | IntRect RenderTarget::getViewport(const View& view) const |
| 279 | { |
| 280 | const auto [width, height] = Vector2f(getSize()); |
| 281 | const FloatRect& viewport = view.getViewport(); |
| 282 | |
| 283 | return IntRect(Rect<long>({std::lround(width * viewport.position.x), std::lround(height * viewport.position.y)}, |
| 284 | {std::lround(width * viewport.size.x), std::lround(height * viewport.size.y)})); |
| 285 | } |
| 286 | |
| 287 | |
| 288 | //////////////////////////////////////////////////////////// |
no outgoing calls
no test coverage detected