mirror of
https://github.com/Drezil/imgui.git
synced 2025-03-28 23:12:46 +00:00
Tidying up - moved ImFontAtlas glyph ranges helpers outside of ImFont block
This commit is contained in:
parent
0783697f87
commit
8b392feba1
68
imgui.cpp
68
imgui.cpp
@ -9669,40 +9669,6 @@ void ImFontAtlas::RenderCustomTexData(int pass, void* p_rects)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// ImFont
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ImFont::ImFont()
|
|
||||||
{
|
|
||||||
Scale = 1.0f;
|
|
||||||
FallbackChar = (ImWchar)'?';
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImFont::~ImFont()
|
|
||||||
{
|
|
||||||
// Invalidate active font so that the user gets a clear crash instead of a dangling pointer.
|
|
||||||
// If you want to delete fonts you need to do it between Render() and NewFrame().
|
|
||||||
ImGuiState& g = *GImGui;
|
|
||||||
if (g.Font == this)
|
|
||||||
g.Font = NULL;
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImFont::Clear()
|
|
||||||
{
|
|
||||||
FontSize = 0.0f;
|
|
||||||
DisplayOffset = ImVec2(-0.5f, 0.5f);
|
|
||||||
Ascent = Descent = 0.0f;
|
|
||||||
ContainerAtlas = NULL;
|
|
||||||
Glyphs.clear();
|
|
||||||
FallbackGlyph = NULL;
|
|
||||||
FallbackXAdvance = 0.0f;
|
|
||||||
IndexXAdvance.clear();
|
|
||||||
IndexLookup.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Retrieve list of range (2 int per range, values are inclusive)
|
// Retrieve list of range (2 int per range, values are inclusive)
|
||||||
const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
|
const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
|
||||||
{
|
{
|
||||||
@ -9801,6 +9767,40 @@ const ImWchar* ImFontAtlas::GetGlyphRangesCyrillic()
|
|||||||
return &ranges[0];
|
return &ranges[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// ImFont
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
ImFont::ImFont()
|
||||||
|
{
|
||||||
|
Scale = 1.0f;
|
||||||
|
FallbackChar = (ImWchar)'?';
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImFont::~ImFont()
|
||||||
|
{
|
||||||
|
// Invalidate active font so that the user gets a clear crash instead of a dangling pointer.
|
||||||
|
// If you want to delete fonts you need to do it between Render() and NewFrame().
|
||||||
|
ImGuiState& g = *GImGui;
|
||||||
|
if (g.Font == this)
|
||||||
|
g.Font = NULL;
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImFont::Clear()
|
||||||
|
{
|
||||||
|
FontSize = 0.0f;
|
||||||
|
DisplayOffset = ImVec2(-0.5f, 0.5f);
|
||||||
|
Ascent = Descent = 0.0f;
|
||||||
|
ContainerAtlas = NULL;
|
||||||
|
Glyphs.clear();
|
||||||
|
FallbackGlyph = NULL;
|
||||||
|
FallbackXAdvance = 0.0f;
|
||||||
|
IndexXAdvance.clear();
|
||||||
|
IndexLookup.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void ImFont::BuildLookupTable()
|
void ImFont::BuildLookupTable()
|
||||||
{
|
{
|
||||||
int max_codepoint = 0;
|
int max_codepoint = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user