Skip to content

Commit

Permalink
Implement ExtraLineHeight and ExtraLineAdvance (fixup: add GetFontLin…
Browse files Browse the repository at this point in the history
…eHeight() and GetFontLineAdvance())
  • Loading branch information
thedmd committed Nov 20, 2021
1 parent e7805fc commit 64208ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7097,6 +7097,16 @@ float ImGui::GetFontSize()
return GImGui->FontSize;
}

float ImGui::GetFontLineHeight()
{
return GImGui->FontLineHeight;
}

float ImGui::GetFontLineAdvance()
{
return GImGui->FontLineAdvance;
}

ImVec2 ImGui::GetFontTexUvWhitePixel()
{
return GImGui->DrawListSharedData.TexUvWhitePixel;
Expand Down
2 changes: 2 additions & 0 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ namespace ImGui
// - Use the style editor (ShowStyleEditor() function) to interactively see what the colors are)
IMGUI_API ImFont* GetFont(); // get current font
IMGUI_API float GetFontSize(); // get current font size (= size in pixels) of current font with current scale applied
IMGUI_API float GetFontLineHeight(); // get current font line height (in pixels) of current font with current scale applied
IMGUI_API float GetFontLineAdvance(); // get current font line advance (in pixels) of current font with current scale applied
IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f); // retrieve given style color with style alpha applied and optional extra alpha multiplier, packed as a 32-bit value suitable for ImDrawList
IMGUI_API ImU32 GetColorU32(const ImVec4& col); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
Expand Down

0 comments on commit 64208ed

Please sign in to comment.