diff options
Diffstat (limited to 'Runtime/GUI/Font.cpp')
-rw-r--r-- | Runtime/GUI/Font.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Runtime/GUI/Font.cpp b/Runtime/GUI/Font.cpp index 4425b17..a2d3078 100644 --- a/Runtime/GUI/Font.cpp +++ b/Runtime/GUI/Font.cpp @@ -188,10 +188,10 @@ bool Font::RenderCharacter(character::Unicode codepoint, int pixelSize) TextHelper::print_glyph(&s_PixelBuffer[0], w, h); - GlyphAtals* atlas = RequestAtlas(pixelSize, Internal::Vector2(w, h)); + GlyphAtals* atlas = RequestAtlas(pixelSize, Vector2(w, h)); Assert(atlas); - Internal::Rect rect = GetRenderChartAndMove(atlas, Internal::Vector2(w, h)); + Rect rect = GetRenderChartAndMove(atlas, Vector2(w, h)); try { @@ -209,7 +209,7 @@ bool Font::RenderCharacter(character::Unicode codepoint, int pixelSize) character.atlas = atlas->index; character.position = rect; - character.bearing = Internal::Vector2(m_FTFace->glyph->bitmap_left, m_FTFace->glyph->bitmap_top); + character.bearing = Vector2(m_FTFace->glyph->bitmap_left, m_FTFace->glyph->bitmap_top); } else // space¡¢tab { @@ -232,7 +232,7 @@ const GlyphAtals* Font::GetGlyphAtlas(int index) return &m_Atlases[index]; } -Internal::Rect Font::GetRenderChartAndMove(GlyphAtals* atlas, Internal::Vector2 preferSize) +Rect Font::GetRenderChartAndMove(GlyphAtals* atlas, Vector2 preferSize) { Rect rect; Vector2 space; @@ -264,7 +264,7 @@ Internal::Rect Font::GetRenderChartAndMove(GlyphAtals* atlas, Internal::Vector2 return rect; } -GlyphAtals* Font::RequestAtlas(int pixelSize, Internal::Vector2 preferSize) +GlyphAtals* Font::RequestAtlas(int pixelSize, Vector2 preferSize) { GlyphAtals* atlas = NULL; auto iter = m_AtlasCache.find(pixelSize); @@ -278,7 +278,7 @@ GlyphAtals* Font::RequestAtlas(int pixelSize, Internal::Vector2 preferSize) newAtlas.width = m_AtlasSize.x; newAtlas.height = m_AtlasSize.y; newAtlas.index = m_Atlases.size(); - newAtlas.cursor = Internal::Vector2(m_AtlasMargin, m_AtlasMargin); + newAtlas.cursor = Vector2(m_AtlasMargin, m_AtlasMargin); m_Atlases.push_back(newAtlas); atlas = &m_Atlases[m_Atlases.size() - 1]; @@ -307,11 +307,11 @@ Texture* Font::CreateAtlas() return tex; } -bool Font::HasEnoughSpace(GlyphAtals* atlas, Internal::Vector2 preferSize) +bool Font::HasEnoughSpace(GlyphAtals* atlas, Vector2 preferSize) { if (atlas == NULL) return false; - Internal::Vector2 space; + Vector2 space; space.x = atlas->width - atlas->cursor.x - m_AtlasMargin; space.y = atlas->height - atlas->cursor.y - m_AtlasMargin; if (space.x > preferSize.x && space.y > preferSize.y) |