From 1d900f123bff8114197552d5c78479802b304978 Mon Sep 17 00:00:00 2001 From: ozlb Date: Tue, 5 May 2020 14:26:20 +0200 Subject: [PATCH] Fix rectangles accumulated at min pos Fix rectangles accumulated at gp.PixelRange.Min.x position --- implot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implot.cpp b/implot.cpp index 9bd0c58..57bf432 100644 --- a/implot.cpp +++ b/implot.cpp @@ -2273,7 +2273,7 @@ inline void PlotDigitalEx(const char* label_id, Getter getter, int count, int of if (pMin.x > gp.PixelRange.Max.x) pMin.x = gp.PixelRange.Max.x; if (pMax.x > gp.PixelRange.Max.x) pMax.x = gp.PixelRange.Max.x; //plot a rectangle that extends up to x2 with y1 height - if (!cull || gp.BB_Grid.Contains(pMin) || gp.BB_Grid.Contains(pMax)) { + if ((pMax.x > pMin.x) && (!cull || gp.BB_Grid.Contains(pMin) || gp.BB_Grid.Contains(pMax))) { auto colAlpha = item->Color; colAlpha.w = item->Highlight ? 1.0 : 0.9; DrawList.AddRectFilled(pMin, pMax, GetColorU32(colAlpha));