MCPcopy Create free account
hub / github.com/chrxh/alien / process

Method process

source/Gui/SimulationScrollbar.cpp:20–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18{}
19
20void _SimulationScrollbar::process(RealRect const& rect)
21{
22 processEvents(rect);
23
24 auto size = rect.bottomRight - rect.topLeft;
25 auto sliderbarRect = calcSliderbarRect(rect);
26 ImGuiWindowFlags windowFlags =
27 ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoDecoration;
28
29 ImGui::SetNextWindowPos(ImVec2(rect.topLeft.x, rect.topLeft.y));
30 ImGui::SetNextWindowSize(ImVec2(size.x, size.y));
31 ImGui::SetNextWindowBgAlpha(Const::WindowAlpha * ImGui::GetStyle().Alpha);
32 ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0);
33 ImGui::Begin(_id.c_str(), NULL, windowFlags);
34
35 ImColor sliderColor = doesMouseCursorIntersectSliderBar(rect) ? ImColor(Const::SimulationSliderColor_Active)
36 : ImColor(Const::SimulationSliderColor_Base);
37 sliderColor.Value.w *= ImGui::GetStyle().Alpha;
38 ImGui::GetWindowDrawList()->AddRectFilled(
39 ImVec2(rect.topLeft.x + sliderbarRect.topLeft.x, rect.topLeft.y + sliderbarRect.topLeft.y),
40 ImVec2(rect.topLeft.x + sliderbarRect.bottomRight.x, rect.topLeft.y + sliderbarRect.bottomRight.y),
41 sliderColor,
42 5.0f);
43
44 ImGui::End();
45 ImGui::PopStyleVar();
46}
47
48void _SimulationScrollbar::processEvents(RealRect const& rect)
49{

Callers

nothing calls this directly

Calls 1

ImVec2Class · 0.85

Tested by

no test coverage detected