diff options
Diffstat (limited to 'Runtime/GUI')
-rw-r--r-- | Runtime/GUI/Font.cpp | 2 | ||||
-rw-r--r-- | Runtime/GUI/UITextMesh.cpp | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Runtime/GUI/Font.cpp b/Runtime/GUI/Font.cpp index a2d3078..207e658 100644 --- a/Runtime/GUI/Font.cpp +++ b/Runtime/GUI/Font.cpp @@ -186,7 +186,7 @@ bool Font::RenderCharacter(character::Unicode codepoint, int pixelSize) memcpy(&s_PixelBuffer[0], pixels, s_SizePerPixel * w * h); } - TextHelper::print_glyph(&s_PixelBuffer[0], w, h); + //TextHelper::print_glyph(&s_PixelBuffer[0], w, h); GlyphAtals* atlas = RequestAtlas(pixelSize, Vector2(w, h)); Assert(atlas); diff --git a/Runtime/GUI/UITextMesh.cpp b/Runtime/GUI/UITextMesh.cpp index 7fc2614..a800dcd 100644 --- a/Runtime/GUI/UITextMesh.cpp +++ b/Runtime/GUI/UITextMesh.cpp @@ -8,6 +8,7 @@ #include <vector> #include <unordered_map> #include "Runtime/Graphics/GfxDevice.h" +#include "Runtime/Utilities/AutoInvoke.h" using namespace std; @@ -75,6 +76,11 @@ UITextMesh::UITextMesh(const UnicodeString& str, Font* font, int pixelSize, int static unordered_map<int, int> s_LineOffsets; s_LineOffsets.clear(); + InvokeWhenLeave([]() { + s_LineWidths.clear(); + s_LineOffsets.clear(); + }); + m_Font = font; const Vector2 atlasSize = font->GetAtlasSize(); @@ -256,8 +262,5 @@ void UITextMesh::Draw() WipeGLError(); vbo->Draw(s_TextMeshVBOLayout); - - WipeGLError(); - g_GfxDevice.ResetUniformsState(); } } |