1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Just accept const char ptr in ImGuiColorTextEdit.

This commit is contained in:
Bartosz Taudul
2018-08-18 01:16:15 +02:00
parent 2c7d457755
commit 69dd0b72c1
3 changed files with 9 additions and 8 deletions
+5 -4
View File
@@ -746,21 +746,22 @@ void TextEditor::Render(const char* aTitle, const ImVec2& aSize, bool aBorder)
mWithinRender = false;
}
void TextEditor::SetText(const std::string & aText)
void TextEditor::SetText(const char* aText)
{
mLines.clear();
for (auto chr : aText)
while( *aText )
{
if (mLines.empty())
mLines.push_back(Line());
if (chr == '\n')
if (*aText == '\n')
mLines.push_back(Line());
else
{
mLines.back().push_back(Glyph(chr, PaletteIndex::Default));
mLines.back().push_back(Glyph(*aText, PaletteIndex::Default));
}
mTextChanged = true;
aText++;
}
mUndoBuffer.clear();