Committed our own changes in ImGUI, see commits

042880ba2d
67c55c7490
a94c952b40
b3f8ae5ca7
2455df4017
3ca3a544a8
870aba8d15
62c2095fe8

This should contain exactly the same changes.
This commit is contained in:
Lukas Matena
2021-07-15 10:24:11 +02:00
parent 63dfb8f5f2
commit 935675a35a
2 changed files with 49 additions and 3 deletions

View File

@@ -34,6 +34,8 @@ Index of this file:
#endif
#include "imgui_internal.h"
#include "imconfig.h"
#ifdef IMGUI_ENABLE_FREETYPE
#include "misc/freetype/imgui_freetype.h"
#endif
@@ -3564,6 +3566,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
const ImU32 col_untinted = col | ~IM_COL32_A_MASK;
ImU32 defaultCol = col;
ImU32 highlighCol = ImGui::GetColorU32(ImGuiCol_ButtonHovered);
// if text is started with ColorMarkerHovered symbol, we should use another color for a highlighting
if (*s == ImGui::ColorMarkerHovered) {
highlighCol = ImGui::GetColorU32(ImGuiCol_FrameBg);
s += 1;
}
while (s < text_end)
{
if (word_wrap_enabled)
@@ -3592,6 +3602,17 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
}
}
if (*s == ImGui::ColorMarkerStart) {
col = highlighCol;
s += 1;
}
else if (*s == ImGui::ColorMarkerEnd) {
col = defaultCol;
s += 1;
if (s == text_end)
break;
}
// Decode and advance source
unsigned int c = (unsigned int)*s;
if (c < 0x80)