diff options
author | chai <chaifix@163.com> | 2021-11-03 13:29:01 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-03 13:29:01 +0800 |
commit | 4428d0ac933482274d09862fd984ac8ede681f7c (patch) | |
tree | 45704fd105a2e71cc1e5de64576f95ebb245b050 /Runtime/GUI/UITextMesh.cpp | |
parent | 5cd2e2299f98065fa06c192df4dfb2c014b2b253 (diff) |
*font space
Diffstat (limited to 'Runtime/GUI/UITextMesh.cpp')
-rw-r--r-- | Runtime/GUI/UITextMesh.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Runtime/GUI/UITextMesh.cpp b/Runtime/GUI/UITextMesh.cpp index 32dec3b..823335f 100644 --- a/Runtime/GUI/UITextMesh.cpp +++ b/Runtime/GUI/UITextMesh.cpp @@ -75,16 +75,19 @@ UITextMesh::UITextMesh(const UnicodeString& str, Font* font,int pixelSize, EText continue; unsigned int atlasIndex = ch->atlas; - TextInfo info; - info.ch = ch; - info.offset = offset; + if (atlasIndex != FONT_NOT_IN_ATLAS_PLACEHOLDER) //·Ç¿Õ¸ñ + { + TextInfo info; + info.ch = ch; + info.offset = offset; - auto list = s_TextInfos.find(atlasIndex); - if (list == s_TextInfos.end()) - s_TextInfos.insert(std::pair<unsigned int, vector<TextInfo>>(atlasIndex, vector<TextInfo>())); + auto list = s_TextInfos.find(atlasIndex); + if (list == s_TextInfos.end()) + s_TextInfos.insert(std::pair<unsigned int, vector<TextInfo>>(atlasIndex, vector<TextInfo>())); - vector<TextInfo>& v = s_TextInfos[atlasIndex]; - v.push_back(info); + vector<TextInfo>& v = s_TextInfos[atlasIndex]; + v.push_back(info); + } offset += ch->advance; } |