mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	ShowFontAtlas, Demo: optionally use style text color for tint. (#6129)
This commit is contained in:
		@@ -13168,10 +13168,13 @@ void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
 | 
			
		||||
        DebugNodeFont(font);
 | 
			
		||||
        PopID();
 | 
			
		||||
    }
 | 
			
		||||
    if (TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
 | 
			
		||||
    if (TreeNode("Font Atlas", "Font Atlas (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
 | 
			
		||||
    {
 | 
			
		||||
        ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
 | 
			
		||||
        ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f);
 | 
			
		||||
        ImGuiContext& g = *GImGui;
 | 
			
		||||
        ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
 | 
			
		||||
        Checkbox("Tint with Text Color", &cfg->ShowAtlasTintedWithTextColor); // Using text color ensure visibility of core atlas data, but will alter custom colored icons
 | 
			
		||||
        ImVec4 tint_col = cfg->ShowAtlasTintedWithTextColor ? GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
 | 
			
		||||
        ImVec4 border_col = GetStyleColorVec4(ImGuiCol_Border);
 | 
			
		||||
        Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), tint_col, border_col);
 | 
			
		||||
        TreePop();
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user