1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-26 20:28:50 -05:00

PlotText color

PlotText color properties inherited from ImGuiCol_Text, so it can be customized by `ImGui::PushStyleColor(ImGuiCol_Text, <myColor>);`
This commit is contained in:
ozlb 2020-08-05 04:59:05 +02:00 committed by GitHub
parent 5c9679c2ab
commit ab9217049a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3439,10 +3439,11 @@ void PlotText(const char* text, double x, double y, bool vertical, const ImVec2&
ImDrawList & DrawList = *ImGui::GetWindowDrawList(); ImDrawList & DrawList = *ImGui::GetWindowDrawList();
PushPlotClipRect(); PushPlotClipRect();
ImVec2 pos = PlotToPixels(ImPlotPoint(x,y)) + pixel_offset; ImVec2 pos = PlotToPixels(ImPlotPoint(x,y)) + pixel_offset;
ImU32 colTxt = ImGui::GetColorU32(ImGuiCol_Text);
if (vertical) if (vertical)
AddTextVertical(&DrawList, text, pos, gp.Col_Txt); AddTextVertical(&DrawList, text, pos, colTxt);
else else
DrawList.AddText(pos, gp.Col_Txt, text); DrawList.AddText(pos, colTxt, text);
PopPlotClipRect(); PopPlotClipRect();
} }