MCPcopy Create free account
hub / github.com/cinder/Cinder / EndBoxSelect

Method EndBoxSelect

src/imgui/imgui_widgets.cpp:7747–7772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7745}
7746
7747void 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

Callers

nothing calls this directly

Calls 6

WindowPosAbsToRelFunction · 0.85
ImClampFunction · 0.85
AddRectFilledMethod · 0.80
AddRectMethod · 0.80
ContainsMethod · 0.45

Tested by

no test coverage detected