| 18 | {} |
| 19 | |
| 20 | void _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 | |
| 48 | void _SimulationScrollbar::processEvents(RealRect const& rect) |
| 49 | { |