Skip to content

Commit 0a88824

Browse files
committed
Obsoleted ImGuiCol_ChildWindowBg fix.
And a warning fix.
1 parent 9f8a336 commit 0a88824

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

TextEditor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -994,10 +994,10 @@ void TextEditor::Render()
994994
}
995995
else
996996
{
997-
char buf[2];
998-
buf[0] = line[cindex].mChar;
999-
buf[1] = '\0';
1000-
width = ImGui::GetFont()->CalcTextSizeA(ImGui::GetFontSize(), FLT_MAX, -1.0f, buf).x;
997+
char buf2[2];
998+
buf2[0] = line[cindex].mChar;
999+
buf2[1] = '\0';
1000+
width = ImGui::GetFont()->CalcTextSizeA(ImGui::GetFontSize(), FLT_MAX, -1.0f, buf2).x;
10011001
}
10021002
}
10031003
ImVec2 cstart(textScreenPos.x + cx, lineStartScreenPos.y);
@@ -1124,7 +1124,7 @@ void TextEditor::Render(const char* aTitle, const ImVec2& aSize, bool aBorder)
11241124
mTextChanged = false;
11251125
mCursorPositionChanged = false;
11261126

1127-
ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, ImGui::ColorConvertU32ToFloat4(mPalette[(int)PaletteIndex::Background]));
1127+
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImGui::ColorConvertU32ToFloat4(mPalette[(int)PaletteIndex::Background]));
11281128
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 0.0f));
11291129
if (!mIgnoreImGuiChild)
11301130
ImGui::BeginChild(aTitle, aSize, aBorder, ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NoMove);

0 commit comments

Comments
 (0)