| 7745 | } |
| 7746 | |
| 7747 | void ImGui::EndBoxSelect(const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags) |
| 7748 | { |
| 7749 | ImGuiContext& g = *GImGui; |
| 7750 | ImGuiWindow* window = g.CurrentWindow; |
| 7751 | ImGuiBoxSelectState* bs = &g.BoxSelectState; |
| 7752 | IM_ASSERT(bs->IsActive); |
| 7753 | bs->UnclipMode = false; |
| 7754 | |
| 7755 | // Render selection rectangle |
| 7756 | bs->EndPosRel = WindowPosAbsToRel(window, ImClamp(g.IO.MousePos, scope_rect.Min, scope_rect.Max)); // Clamp stored position according to current scrolling view |
| 7757 | ImRect box_select_r = bs->BoxSelectRectCurr; |
| 7758 | box_select_r.ClipWith(scope_rect); |
| 7759 | window->DrawList->AddRectFilled(box_select_r.Min, box_select_r.Max, GetColorU32(ImGuiCol_SeparatorHovered, 0.30f)); // FIXME-MULTISELECT: Styling |
| 7760 | window->DrawList->AddRect(box_select_r.Min, box_select_r.Max, GetColorU32(ImGuiCol_NavCursor)); // FIXME-MULTISELECT FIXME-DPI: Styling |
| 7761 | |
| 7762 | // Scroll |
| 7763 | const bool enable_scroll = (ms_flags & ImGuiMultiSelectFlags_ScopeWindow) && (ms_flags & ImGuiMultiSelectFlags_BoxSelectNoScroll) == 0; |
| 7764 | if (enable_scroll) |
| 7765 | { |
| 7766 | ImRect scroll_r = scope_rect; |
| 7767 | scroll_r.Expand(-g.FontSize); |
| 7768 | //GetForegroundDrawList()->AddRect(scroll_r.Min, scroll_r.Max, IM_COL32(0, 255, 0, 255)); |
| 7769 | if (!scroll_r.Contains(g.IO.MousePos)) |
| 7770 | BoxSelectScrollWithMouseDrag(bs, window, scroll_r); |
| 7771 | } |
| 7772 | } |
| 7773 | |
| 7774 | //------------------------------------------------------------------------- |
| 7775 | // [SECTION] Widgets: Multi-Select support |
nothing calls this directly
no test coverage detected