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

Update implot.cpp

This commit is contained in:
ozlb 2020-04-30 15:01:28 +02:00 committed by GitHub
parent 6e860842e1
commit a13de8ec98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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); 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()!"); IM_ASSERT_USER_ERROR(gp.CurrentPlot != NULL, "PlotDigital() Needs to be called between BeginPlot() and EndPlot()!");
ImPlotItem* item = gp.RegisterItem(label_id); 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; 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) if (gp.Style.Colors[ImPlotCol_Line].w != -1)
item->Color = gp.Style.Colors[ImPlotCol_Line]; 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.x = r;
cr.y = y2; cr.y = y2;
if (!cull || gp.BB_Grid.Contains(cl) || gp.BB_Grid.Contains(cr)) { 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++; gp.DigitalPlotItemCnt++;