mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-08 16:01:19 +12:00
Automatically scale imgui text based on display pixel density (#545)
This commit is contained in:
parent
503e99d069
commit
2cfb7f3737
7 changed files with 52 additions and 19 deletions
|
@ -50,6 +50,14 @@ extern char const g_fontawesome_data[];
|
|||
std::unordered_map<int, ImFont*> g_imgui_fonts;
|
||||
std::stack<int> g_font_requests;
|
||||
|
||||
bool ImGui_BeginPadDistinct(const char* name, bool* p_open, ImGuiWindowFlags flags, bool pad)
|
||||
{
|
||||
std::string distinctName = name;
|
||||
if (pad)
|
||||
distinctName += "##pad";
|
||||
return ImGui::Begin(distinctName.c_str(), p_open, flags);
|
||||
}
|
||||
|
||||
void ImGui_PrecacheFonts()
|
||||
{
|
||||
while (!g_font_requests.empty())
|
||||
|
|
|
@ -9,6 +9,8 @@ inline ImVec2 operator-(const ImVec2& l, const ImVec2& r) { return{ l.x - r.x, l
|
|||
inline bool operator<(const ImVec2& lhs, const ImVec2& rhs) { return lhs.x < rhs.x; }
|
||||
inline bool operator>=(const ImVec2& lhs, const ImVec2& rhs) { return lhs.x >= rhs.x; }
|
||||
|
||||
bool ImGui_BeginPadDistinct(const char* name, bool* p_open, ImGuiWindowFlags flags, bool pad);
|
||||
|
||||
void ImGui_PrecacheFonts();
|
||||
ImFont* ImGui_GetFont(float size);
|
||||
void ImGui_UpdateWindowInformation(bool mainWindow);
|
Loading…
Add table
Add a link
Reference in a new issue