1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2025-01-30 19:08:51 -05:00

Fix rectangles accumulated at min pos

Fix rectangles accumulated at gp.PixelRange.Min.x position
This commit is contained in:
ozlb 2020-05-05 14:26:20 +02:00 committed by GitHub
parent 5e3b283f5e
commit 1d900f123b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));