mirror of
https://github.com/gwm17/implot.git
synced 2024-11-23 02:38:53 -05:00
Update implot.cpp
This commit is contained in:
parent
6e860842e1
commit
a13de8ec98
|
@ -1701,8 +1701,7 @@ void PlotDigital(const char* label_id, const float* xs, const float* ys, int cou
|
|||
PlotDigital(label_id, &ImPlotGetter2D, (void*)&data, count, offset);
|
||||
}
|
||||
|
||||
void PlotDigital(const char* label_id, ImVec2 (*getter)(void* data, int idx), void* data, int count, int offset)
|
||||
{
|
||||
void PlotDigital(const char* label_id, ImVec2 (*getter)(void* data, int idx), void* data, int count, int offset) {
|
||||
IM_ASSERT_USER_ERROR(gp.CurrentPlot != NULL, "PlotDigital() Needs to be called between BeginPlot() and EndPlot()!");
|
||||
|
||||
ImPlotItem* item = gp.RegisterItem(label_id);
|
||||
|
@ -1713,8 +1712,6 @@ void PlotDigital(const char* label_id, ImVec2 (*getter)(void* data, int idx), vo
|
|||
|
||||
const bool rend_line = gp.Style.Colors[ImPlotCol_Line].w != 0 && gp.Style.LineWeight > 0;
|
||||
|
||||
ImU32 col_line = gp.Style.Colors[ImPlotCol_Line].w == -1 ? GetColorU32(item->Color) : GetColorU32(gp.Style.Colors[ImPlotCol_Line]);
|
||||
|
||||
if (gp.Style.Colors[ImPlotCol_Line].w != -1)
|
||||
item->Color = gp.Style.Colors[ImPlotCol_Line];
|
||||
|
||||
|
@ -1757,7 +1754,9 @@ void PlotDigital(const char* label_id, ImVec2 (*getter)(void* data, int idx), vo
|
|||
cr.x = r;
|
||||
cr.y = y2;
|
||||
if (!cull || gp.BB_Grid.Contains(cl) || gp.BB_Grid.Contains(cr)) {
|
||||
DrawList.AddRectFilled({l, y1}, {r, y2}, col_line);
|
||||
auto colAlpha = item->Color;
|
||||
colAlpha.w = item->Highlight ? 1.0 : 0.9;
|
||||
DrawList.AddRectFilled({l, y1}, {r, y2}, GetColorU32(colAlpha));
|
||||
}
|
||||
}
|
||||
gp.DigitalPlotItemCnt++;
|
||||
|
|
Loading…
Reference in New Issue
Block a user