From 0a88824f7de8d0bd11d8419066caa7d3469395c4 Mon Sep 17 00:00:00 2001 From: BalazsJako Date: Sat, 15 Jun 2019 12:51:51 +0100 Subject: [PATCH] Obsoleted ImGuiCol_ChildWindowBg fix. And a warning fix. --- TextEditor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TextEditor.cpp b/TextEditor.cpp index 6e669dd4..02966f0b 100644 --- a/TextEditor.cpp +++ b/TextEditor.cpp @@ -994,10 +994,10 @@ void TextEditor::Render() } else { - char buf[2]; - buf[0] = line[cindex].mChar; - buf[1] = '\0'; - width = ImGui::GetFont()->CalcTextSizeA(ImGui::GetFontSize(), FLT_MAX, -1.0f, buf).x; + char buf2[2]; + buf2[0] = line[cindex].mChar; + buf2[1] = '\0'; + width = ImGui::GetFont()->CalcTextSizeA(ImGui::GetFontSize(), FLT_MAX, -1.0f, buf2).x; } } ImVec2 cstart(textScreenPos.x + cx, lineStartScreenPos.y); @@ -1124,7 +1124,7 @@ void TextEditor::Render(const char* aTitle, const ImVec2& aSize, bool aBorder) mTextChanged = false; mCursorPositionChanged = false; - ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, ImGui::ColorConvertU32ToFloat4(mPalette[(int)PaletteIndex::Background])); + ImGui::PushStyleColor(ImGuiCol_ChildBg, ImGui::ColorConvertU32ToFloat4(mPalette[(int)PaletteIndex::Background])); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 0.0f)); if (!mIgnoreImGuiChild) ImGui::BeginChild(aTitle, aSize, aBorder, ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NoMove);