ImFontAtlas: Added TexDesiredWidth and tweaked default cheapo best-width choice(#327)

This commit is contained in:
ocornut
2015-09-11 16:50:00 +01:00
parent bc8eb5e9cf
commit 0abe668221
3 changed files with 6 additions and 6 deletions

View File

@ -206,9 +206,8 @@ void ImGui::ShowTestWindow(bool* opened)
{
ImGui::TextWrapped("Tip: Load fonts with io.Fonts->AddFontFromFileTTF().");
ImFontAtlas* atlas = ImGui::GetIO().Fonts;
if (ImGui::TreeNode("Atlas texture"))
if (ImGui::TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
{
ImGui::Text("%dx%d pixels", atlas->TexWidth, atlas->TexHeight);
ImGui::Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0,0), ImVec2(1,1), ImColor(255,255,255,255), ImColor(255,255,255,128));
ImGui::TreePop();
}