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

render x-axis drag/drop hover (#149)

Co-authored-by: Philippe Kehl <philippe.kehl@fixposition.com>
This commit is contained in:
Philippe Kehl 2021-01-20 02:52:34 +01:00 committed by GitHub
parent 6e2499093b
commit e64df657b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2279,6 +2279,16 @@ void EndPlot() {
} }
} }
// render x-axis drag/drop hover
if (plot.XAxis.Present && ImGui::IsDragDropPayloadBeingAccepted()) {
if (plot.XAxis.ExtHovered) {
float y_loc = plot.XAxis.HoverRect.Min.y;
ImVec2 p1(plot.XAxis.HoverRect.Min.x - 5, y_loc - 5);
ImVec2 p2(plot.XAxis.HoverRect.Max.x + 5, y_loc + 5);
DrawList.AddRect(p1, p2, ImGui::GetColorU32(ImGuiCol_DragDropTarget), 0.0f, ImDrawCornerFlags_All, 2.0f);
}
}
PushPlotClipRect(); PushPlotClipRect();
// render selection/query // render selection/query
if (plot.Selecting) { if (plot.Selecting) {