Fix compiling on C++98

This commit is contained in:
Jake Coxon
2020-07-21 15:35:31 +01:00
committed by ocornut
parent 15545a7925
commit 3232e7bb03
2 changed files with 5 additions and 4 deletions

View File

@@ -454,11 +454,12 @@ void ImGui::StyleWin98(ImGuiStyle* dst)
// In retrorespect I should have used an icon map like FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS
unsigned char minimize[] = {86,6,6,6,0};
unsigned char close[] = {14,2,4,2,5,2,2,2,7,4,9,2,9,4,7,2,2,2,5,2,4,2,0};
unsigned char *run_length[] = {minimize, close};
unsigned char *run_length[] = {close, minimize};
int rect_ids[IM_ARRAYSIZE(run_length)];
for (int i = 0; i < IM_ARRAYSIZE(run_length); i++) {
rect_ids[i] = io.Fonts->AddCustomRectFontGlyph(font, (ImWchar)(214 + i), 12, 9, 13+1);
// Starts with unicode multiplication sign and extends
rect_ids[i] = io.Fonts->AddCustomRectFontGlyph(font, (ImWchar)(215 + i), 12, 9, 13+1);
}
io.Fonts->Build();

View File

@@ -868,7 +868,7 @@ bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos)
#ifdef WIN98 // close button icon
IM_UNUSED(cross_col);
IM_UNUSED(cross_extent);
RenderText(bb.Min + ImVec2(2.0f, 2.0f), "\u00D7");
RenderText(bb.Min + ImVec2(2.0f, 2.0f), "\xC3\x97");
#else
window->DrawList->AddLine(center + ImVec2(+cross_extent, +cross_extent), center + ImVec2(-cross_extent, -cross_extent), cross_col, 1.0f);
window->DrawList->AddLine(center + ImVec2(+cross_extent, -cross_extent), center + ImVec2(-cross_extent, +cross_extent), cross_col, 1.0f);
@@ -904,7 +904,7 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
WinAddRect(bb.Min, bb.Max, hovered && held);
// collapse icon
RenderText(bb.Min + ImVec2(2.0f, 2.0f), "\u00D6");
RenderText(bb.Min + ImVec2(2.0f, 2.0f), "\xC3\x98");
#else
if (hovered || held)
window->DrawList->AddCircleFilled(bb.GetCenter() + ImVec2(0.0f, -0.5f), g.FontSize * 0.5f + 1.0f, bg_col);