An automatic aspect ratio menu entry is now added even for themes that only have a single aspect ratio defined.

This commit is contained in:
Leon Styhre 2022-12-17 19:47:37 +01:00
parent 4a5e8d674e
commit aaa96cd8dd

View file

@ -1063,8 +1063,8 @@ ThemeData::ThemeCapability ThemeData::parseThemeCapabilities(const std::string&
// Add the aspect ratios in the order they are defined in sSupportedAspectRatios so they // Add the aspect ratios in the order they are defined in sSupportedAspectRatios so they
// always show up in the same order in the UI Settings menu. // always show up in the same order in the UI Settings menu.
if (!aspectRatiosTemp.empty()) { if (!aspectRatiosTemp.empty()) {
// Add the "automatic" aspect ratio if there is more than one entry. // Add the "automatic" aspect ratio if there is at least one entry.
if (aspectRatiosTemp.size() > 1) if (!aspectRatiosTemp.empty())
capabilities.aspectRatios.emplace_back(sSupportedAspectRatios.front().first); capabilities.aspectRatios.emplace_back(sSupportedAspectRatios.front().first);
for (auto& aspectRatio : sSupportedAspectRatios) { for (auto& aspectRatio : sSupportedAspectRatios) {
if (std::find(aspectRatiosTemp.cbegin(), aspectRatiosTemp.cend(), aspectRatio.first) != if (std::find(aspectRatiosTemp.cbegin(), aspectRatiosTemp.cend(), aspectRatio.first) !=