Demo: Clamping font scale. Added helpers in demo. Comments. Update sponsors. (#3206)

This commit is contained in:
omar
2020-05-07 11:38:45 +02:00
parent f152fac4f1
commit 673d6df85f
3 changed files with 29 additions and 9 deletions

View File

@ -6610,6 +6610,7 @@ ImVec2 ImGui::GetFontTexUvWhitePixel()
void ImGui::SetWindowFontScale(float scale)
{
IM_ASSERT(scale > 0.0f);
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
window->FontWindowScale = scale;
@ -6818,6 +6819,7 @@ static void ImGui::ErrorCheckEndFrameSanityChecks()
ImGuiContext& g = *GImGui;
// Verify that io.KeyXXX fields haven't been tampered with. Key mods should not be modified between NewFrame() and EndFrame()
// One possible reason leading to this assert is that your back-ends update inputs _AFTER_ NewFrame().
const ImGuiKeyModFlags expected_key_mod_flags = GetMergedKeyModFlags();
IM_ASSERT(g.IO.KeyMods == expected_key_mod_flags && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods");
IM_UNUSED(expected_key_mod_flags);