| 358 | } |
| 359 | |
| 360 | MenuSection* MainMenu::SwitchToSectionDirect(std::unique_ptr<MenuSection> section) |
| 361 | { |
| 362 | if (!_sections.empty()) { |
| 363 | auto& lastSection = _sections.back(); |
| 364 | lastSection->OnHide(); |
| 365 | } |
| 366 | |
| 367 | auto& currentSection = _sections.emplace_back(std::move(section)); |
| 368 | currentSection->OnShow(this); |
| 369 | |
| 370 | if (_contentBounds != Recti::Empty) { |
| 371 | Recti clipRectangle = currentSection->GetClipRectangle(_contentBounds); |
| 372 | _upscalePass.SetClipRectangle(clipRectangle); |
| 373 | } |
| 374 | |
| 375 | return currentSection.get(); |
| 376 | } |
| 377 | |
| 378 | void MainMenu::LeaveSection() |
| 379 | { |
nothing calls this directly
no test coverage detected