MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / RenderGridLinesX

Function RenderGridLinesX

Source/3rdParty/implot/implot.cpp:1822–1838  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1820//-----------------------------------------------------------------------------
1821
1822static inline void RenderGridLinesX(ImDrawList& DrawList, const ImPlotTicker& ticker, const ImRect& rect, ImU32 col_maj, ImU32 col_min, float size_maj, float size_min) {
1823 const float density = ticker.TickCount() / rect.GetWidth();
1824 ImVec4 col_min4 = ImGui::ColorConvertU32ToFloat4(col_min);
1825 col_min4.w *= ImClamp(ImRemap(density, 0.1f, 0.2f, 1.0f, 0.0f), 0.0f, 1.0f);
1826 col_min = ImGui::ColorConvertFloat4ToU32(col_min4);
1827 for (int t = 0; t < ticker.TickCount(); t++) {
1828 const ImPlotTick& xt = ticker.Ticks[t];
1829 if (xt.PixelPos < rect.Min.x || xt.PixelPos > rect.Max.x)
1830 continue;
1831 if (xt.Level == 0) {
1832 if (xt.Major)
1833 DrawList.AddLine(ImVec2(xt.PixelPos, rect.Min.y), ImVec2(xt.PixelPos, rect.Max.y), col_maj, size_maj);
1834 else if (density < 0.2f)
1835 DrawList.AddLine(ImVec2(xt.PixelPos, rect.Min.y), ImVec2(xt.PixelPos, rect.Max.y), col_min, size_min);
1836 }
1837 }
1838}
1839
1840static inline void RenderGridLinesY(ImDrawList& DrawList, const ImPlotTicker& ticker, const ImRect& rect, ImU32 col_maj, ImU32 col_min, float size_maj, float size_min) {
1841 const float density = ticker.TickCount() / rect.GetHeight();

Callers 2

SetupFinishFunction · 0.85
EndPlotFunction · 0.85

Calls 6

ImClampFunction · 0.85
ImRemapFunction · 0.85
ImVec2Function · 0.85
TickCountMethod · 0.80
GetWidthMethod · 0.45
AddLineMethod · 0.45

Tested by

no test coverage detected