button_guide: fix luminance for low quality font

This commit is contained in:
Hyper 2024-12-09 03:30:59 +00:00
parent f694b0d219
commit d6fcce918a
2 changed files with 12 additions and 11 deletions

View file

@ -178,20 +178,21 @@ static void DrawGuide(float* offset, ImVec2 regionMin, ImVec2 regionMax, EButton
auto btnIcon = GetButtonIcon(_icon);
drawList->AddImage(std::get<1>(btnIcon), iconMin, iconMax, GET_UV_COORDS(std::get<0>(btnIcon)));
auto font = GetFont(fontQuality);
auto textMarginX = alignment == EButtonAlignment::Left
? regionMin.x + *offset + dualIconMarginX
: regionMax.x - *offset - dualIconMarginX * 2;
DrawTextWithOutline<int>
(
GetFont(fontQuality),
fontSize,
{ /* X */ textMarginX, /* Y */ regionMin.y + Scale(8) },
IM_COL32(255, 255, 255, 255),
text,
2,
IM_COL32(0, 0, 0, 255)
);
auto textMarginY = regionMin.y + Scale(8);
ImVec2 textPosition = { textMarginX, textMarginY };
DrawTextWithOutline<int>(font, fontSize, textPosition, IM_COL32_WHITE, text, 2, IM_COL32_BLACK);
// Add extra luminance to low quality text.
if (fontQuality == EFontQuality::Low)
drawList->AddText(font, fontSize, textPosition, IM_COL32(255, 255, 255, 127), text);
if (icon == EButtonIcon::LBRB || icon == EButtonIcon::LTRT)
{

View file

@ -36,7 +36,7 @@
#include <res/images/options_menu/thumbnails/window_size.dds.h>
#include <res/images/options_menu/thumbnails/xbox_color_correction.dds.h>
static std::unordered_map<std::string_view, std::unique_ptr<GuestTexture>> g_thumbnails;
inline static std::unordered_map<std::string_view, std::unique_ptr<GuestTexture>> g_thumbnails;
static void LoadThumbnails()
{