1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-23 02:38:53 -05:00

Merge pull request #96 from jaswantp/SkipDrawQuery

Draw query rect only when query enabled.
This commit is contained in:
Evan Pezent 2020-08-19 11:37:45 -05:00 committed by GitHub
commit c1daaab8ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1323,20 +1323,23 @@ void EndPlot() {
} }
} }
if (plot.Querying || plot.Queried) { if (ImHasFlag(plot.Flags, ImPlotFlags_Query)) // draw query rect only when query enabled.
if (plot.QueryRect.GetWidth() > 2 && plot.QueryRect.GetHeight() > 2) { {
DrawList.AddRectFilled(plot.QueryRect.Min + gp.BB_Plot.Min, plot.QueryRect.Max + gp.BB_Plot.Min, gp.Col_QryBg); if (plot.Querying || plot.Queried) {
DrawList.AddRect( plot.QueryRect.Min + gp.BB_Plot.Min, plot.QueryRect.Max + gp.BB_Plot.Min, gp.Col_QryBd); if (plot.QueryRect.GetWidth() > 2 && plot.QueryRect.GetHeight() > 2) {
DrawList.AddRectFilled(plot.QueryRect.Min + gp.BB_Plot.Min, plot.QueryRect.Max + gp.BB_Plot.Min, gp.Col_QryBg);
DrawList.AddRect( plot.QueryRect.Min + gp.BB_Plot.Min, plot.QueryRect.Max + gp.BB_Plot.Min, gp.Col_QryBd);
}
} }
} else if (plot.Queried) {
else if (plot.Queried) { ImRect bb_query = plot.QueryRect;
ImRect bb_query = plot.QueryRect;
bb_query.Min += gp.BB_Plot.Min; bb_query.Min += gp.BB_Plot.Min;
bb_query.Max += gp.BB_Plot.Min; bb_query.Max += gp.BB_Plot.Min;
DrawList.AddRectFilled(bb_query.Min, bb_query.Max, gp.Col_QryBg); DrawList.AddRectFilled(bb_query.Min, bb_query.Max, gp.Col_QryBg);
DrawList.AddRect( bb_query.Min, bb_query.Max, gp.Col_QryBd); DrawList.AddRect( bb_query.Min, bb_query.Max, gp.Col_QryBd);
}
} }
// render legend // render legend