ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
57.81k stars 9.91k forks source link

Small space between window bar and body #7007

Open dlamei opened 7 months ago

dlamei commented 7 months ago

When setting WindowRounding > 0 and io.FontGlobalScale to some non-integer values, a pixel wide space appears between the title bar and body of the window

But it does not happen with every non integer FontGlobalScale

image WindowRounding = 0, FontGlobalScale = 1.2

image WindowRounding = 1, FontGlobalScale = 1.2

image WindowRounding = 1, FontGlobalScale = 1.3

example:


io.FontGlobalScale = 1.2;

// Colors to make it more visible
ImGui::PushStyleColor(ImGuiCol_WindowBg, { 0, 0, 0, 1 });
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 1);

ImGui::Begin("###1");
ImGui::End();

ImGui::PushStyleColor(ImGuiCol_WindowBg, { 1, 1, 1, 1 });
ImGui::Begin("###2");
ImGui::End();

ImGui::PopStyleColor(2);
ImGui::PopStyleVar();

Version: 1.90 (WIP) Branch: master

Opengl3 + GLFW Operating System: Windows 10 and Ubuntu 20

ocornut commented 7 months ago

We don’t really support non integer sized fonts and therefore non-integer values of FontGlobalScale.