2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 12:27:43 +00:00

string_view refactor

This commit is contained in:
Jack Andersen
2017-11-12 20:14:52 -10:00
parent 4ba4022277
commit 1b7874a7b2
31 changed files with 216 additions and 196 deletions

View File

@@ -401,7 +401,7 @@ int TextView::DoKern(FT_Pos val, const FontAtlas& atlas)
return FT_PIX_ROUND(val) >> 6;
}
void TextView::typesetGlyphs(const std::string& str, const zeus::CColor& defaultColor)
void TextView::typesetGlyphs(std::string_view str, const zeus::CColor& defaultColor)
{
UTF8Iterator it(str.begin());
size_t charLen = str.size() ? std::min(it.countTo(str.end()), m_capacity) : 0;
@@ -471,7 +471,7 @@ void TextView::typesetGlyphs(const std::string& str, const zeus::CColor& default
updateSize();
}
void TextView::typesetGlyphs(const std::wstring& str, const zeus::CColor& defaultColor)
void TextView::typesetGlyphs(std::wstring_view str, const zeus::CColor& defaultColor)
{
size_t charLen = std::min(str.size(), m_capacity);
_commitResources(charLen);