MCPcopy Create free account
hub / github.com/SatDump/SatDump / ColormapIcon

Function ColormapIcon

src-core/imgui/implot/implot.cpp:4835–4845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4833}
4834
4835void ColormapIcon(ImPlotColormap cmap) {
4836 ImPlotContext& gp = *GImPlot;
4837 const float txt_size = ImGui::GetTextLineHeight();
4838 ImVec2 size(txt_size-4,txt_size);
4839 ImGuiWindow* window = ImGui::GetCurrentWindow();
4840 ImVec2 pos = window->DC.CursorPos;
4841 ImRect rect(pos+ImVec2(0,2),pos+size-ImVec2(0,2));
4842 ImDrawList& DrawList = *ImGui::GetWindowDrawList();
4843 RenderColorBar(gp.ColormapData.GetKeys(cmap),gp.ColormapData.GetKeyCount(cmap),DrawList,rect,false,false,!gp.ColormapData.IsQual(cmap));
4844 ImGui::Dummy(size);
4845}
4846
4847ImDrawList* GetPlotDrawList() {
4848 return ImGui::GetWindowDrawList();

Callers 1

Demo_ColormapWidgetsFunction · 0.85

Calls 6

GetCurrentWindowFunction · 0.85
ImVec2Function · 0.85
RenderColorBarFunction · 0.85
GetKeysMethod · 0.80
GetKeyCountMethod · 0.80
IsQualMethod · 0.80

Tested by

no test coverage detected