| 2540 | |
| 2541 | template <typename _GetterPos, typename _GetterNeg> |
| 2542 | void PlotErrorBarsVEx(const char* label_id, const _GetterPos& getter_pos, const _GetterNeg& getter_neg, const ImPlotSpec& spec) { |
| 2543 | if (BeginItemEx(label_id, Fitter2<_GetterPos,_GetterNeg>(getter_pos, getter_neg), spec, IMPLOT_AUTO_COL)) { |
| 2544 | if (getter_pos.Count <= 0 || getter_neg.Count <= 0) { |
| 2545 | EndItem(); |
| 2546 | return; |
| 2547 | } |
| 2548 | const ImPlotNextItemData& s = GetItemData(); |
| 2549 | ImDrawList& draw_list = *GetPlotDrawList(); |
| 2550 | const ImU32 col = ImGui::GetColorU32( IsColorAuto(spec.LineColor) ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : s.Spec.LineColor ); |
| 2551 | const bool rend_whisker = s.Spec.Size > 0; |
| 2552 | const float half_whisker = s.Spec.Size * 0.5f; |
| 2553 | for (int i = 0; i < getter_pos.Count; ++i) { |
| 2554 | ImVec2 p1 = PlotToPixels(getter_neg[i],IMPLOT_AUTO,IMPLOT_AUTO); |
| 2555 | ImVec2 p2 = PlotToPixels(getter_pos[i],IMPLOT_AUTO,IMPLOT_AUTO); |
| 2556 | draw_list.AddLine(p1,p2,col, s.Spec.LineWeight); |
| 2557 | if (rend_whisker) { |
| 2558 | draw_list.AddLine(p1 - ImVec2(half_whisker, 0), p1 + ImVec2(half_whisker, 0), col, s.Spec.LineWeight); |
| 2559 | draw_list.AddLine(p2 - ImVec2(half_whisker, 0), p2 + ImVec2(half_whisker, 0), col, s.Spec.LineWeight); |
| 2560 | } |
| 2561 | } |
| 2562 | EndItem(); |
| 2563 | } |
| 2564 | } |
| 2565 | |
| 2566 | template <typename _GetterPos, typename _GetterNeg> |
| 2567 | void PlotErrorBarsHEx(const char* label_id, const _GetterPos& getter_pos, const _GetterNeg& getter_neg, const ImPlotSpec& spec) { |
no test coverage detected