소스 검색

Fix compiling on C++98

Jake Coxon 5 년 전
부모
커밋
f66022247e
2개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 2
      imgui_draw.cpp
  2. 2 2
      imgui_widgets.cpp

+ 3 - 2
imgui_draw.cpp

@@ -435,11 +435,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, 214 + i, 12, 9, 13+1);
+        // Starts with unicode multiplication sign and extends
+        rect_ids[i] = io.Fonts->AddCustomRectFontGlyph(font, 215 + i, 12, 9, 13+1);
     }
 
     io.Fonts->Build();

+ 2 - 2
imgui_widgets.cpp

@@ -803,7 +803,7 @@ bool ImGui::CloseButton(ImGuiID id, const ImVec2& pos)//, float size)
     ImU32 cross_col = GetColorU32(ImGuiCol_Text);
     center -= ImVec2(0.5f, 0.5f);
 #ifdef WIN98 // close button icon
-    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);
@@ -837,7 +837,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(center/*+ ImVec2(0.0f, -0.5f)*/, g.FontSize * 0.5f + 1.0f, bg_col, 12);