Remove some uses of textScale

This commit is contained in:
Henrik Rydgård committed 2026-02-06 14:30:47 +01:00
1 parent de702ced45
commit b1fa6b4671
4 files changed
+8 -9

No files matched your search

+2 -2
View File
@@ -136,10 +136,10 @@ zip_int64_t ZipContainer::SourceCallback(void *userdata, void *data, zip_uint64_
}
}
ZipFileReader *ZipFileReader::Create(const Path &zipFile, const char *inZipPath, bool logErrors) {
ZipFileReader *ZipFileReader::Create(const Path &zipFile, std::string_view inZipPath, bool logErrors) {
// The inZipPath is supposed to be a folder, and internally in this class, we suffix
// folder paths with '/', matching how the zip library works.
std::string path = inZipPath;
std::string path(inZipPath);
if (!path.empty() && path.back() != '/') {
path.push_back('/');
}
+1 -1
View File
@@ -39,7 +39,7 @@ private:
class ZipFileReader : public VFSBackend {
public:
static ZipFileReader *Create(const Path &zipFile, const char *inZipPath, bool logErrors = true);
static ZipFileReader *Create(const Path &zipFile, std::string_view inZipPath, bool logErrors = true);
~ZipFileReader();
bool IsValid() const { return zip_file_ != nullptr; }
+3 -5
View File
@@ -5,8 +5,6 @@
#include "Common/StringUtils.h"
#include "Common/System/OSD.h"
static const float extraTextScale = 0.7f;
uint32_t GetNoticeBackgroundColor(NoticeLevel type) {
// Colors from Infima
switch (type) {
@@ -79,7 +77,7 @@ void MeasureNotice(const UIContext &dc, NoticeLevel level, std::string_view text
float width2 = 0.0f, height2 = 0.0f;
if (!details.empty()) {
dc.MeasureTextRect(dc.GetTheme().uiFont, extraTextScale, extraTextScale, details, availableWidth, &width2, &height2, align | FLAG_WRAP_TEXT);
dc.MeasureTextRect(dc.GetTheme().uiFontSmall, 1.0f, 1.0f, details, availableWidth, &width2, &height2, align | FLAG_WRAP_TEXT);
*width = std::max(*width, width2);
}
@@ -159,8 +157,8 @@ void RenderNotice(UIContext &dc, Bounds bounds, float height1, NoticeLevel level
UI::Drawable backgroundDark = UI::Drawable(colorAlpha(darkenColor(GetNoticeBackgroundColor(level)), alpha));
dc.FillRect(backgroundDark, bottomTextBounds);
}
dc.SetFontScale(extraTextScale, extraTextScale);
dc.SetFontStyle(dc.GetTheme().uiFontSmall);
dc.DrawTextRect(details, bottomTextBounds.Inset(1.0f, 1.0f), foreGround, (align & FLAG_DYNAMIC_ASCII) | ALIGN_LEFT | FLAG_WRAP_TEXT);
}
dc.SetFontScale(1.0f, 1.0f);
dc.SetFontStyle(dc.GetTheme().uiFont);
}
+2 -1
View File
@@ -58,6 +58,7 @@
#include "Core/HW/Display.h"
#include "Core/Config.h"
#include "Core/Core.h"
#include "Core/Util/PathUtil.h"
#include "Core/CoreTiming.h"
#include "Core/CoreParameter.h"
#include "Core/FileLoaders/RamCachingFileLoader.h"
@@ -300,7 +301,7 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin
// TODO: Better would be to check that it was loaded successfully.
if (!File::Exists(g_CoreParameter.fileToStart / INDEX_FILENAME)) {
auto sc = GetI18NCategory(I18NCat::SCREEN);
g_OSD.Show(OSDType::MESSAGE_WARNING, sc->T("ExtractedIsoWarning", "Extracted ISOs often don't work.\nPlay the ISO file directly."), g_CoreParameter.fileToStart.ToVisualString(), 7.0f);
g_OSD.Show(OSDType::MESSAGE_WARNING, sc->T("ExtractedIsoWarning", "Extracted ISOs often don't work.\nPlay the ISO file directly."), GetFriendlyPath(g_CoreParameter.fileToStart), 7.0f);
} else {
INFO_LOG(Log::Loader, "Extracted ISO loaded without warning - %s is present.", INDEX_FILENAME.c_str());
}