mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[wpigui] Reload fonts to scale rather than preloading (#4712)
This commit is contained in:
@@ -26,10 +26,7 @@ struct SavedSettings {
|
||||
int style = 0;
|
||||
};
|
||||
|
||||
struct Font {
|
||||
static constexpr int kScaledLevels = 9;
|
||||
ImFont* scaled[kScaledLevels];
|
||||
};
|
||||
constexpr int kFontScaledLevels = 9;
|
||||
|
||||
struct Context : public SavedSettings {
|
||||
std::atomic_bool exit{false};
|
||||
@@ -56,12 +53,14 @@ struct Context : public SavedSettings {
|
||||
std::vector<std::function<void()>> lateExecutors;
|
||||
|
||||
int fontScale = 2; // updated by main loop
|
||||
std::vector<Font> fonts;
|
||||
std::vector<ImFont*> fonts;
|
||||
|
||||
std::vector<GLFWimage> icons;
|
||||
|
||||
std::string iniPath = "imgui.ini";
|
||||
bool resetOnExit = false;
|
||||
|
||||
bool reloadFonts = false; // reload fonts in next PlatformRenderFrame()
|
||||
};
|
||||
|
||||
extern Context* gContext;
|
||||
|
||||
Reference in New Issue
Block a user