From 0b981f9b4d0cd8a11f0123f0a5d641048b57f3b2 Mon Sep 17 00:00:00 2001 From: tobid7 Date: Wed, 26 Jun 2024 08:57:08 +0200 Subject: [PATCH] Add Beta Slider Dragging --- source/UI7.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/UI7.cpp b/source/UI7.cpp index 2717570..60b194b 100644 --- a/source/UI7.cpp +++ b/source/UI7.cpp @@ -448,6 +448,14 @@ void UI7CtxEndMenu() { static_cast(ui7_ctx->cm->ms.y)); // Create Real Slider Height int slider_rh = d7min(d7max(slider_h, (float)lszs), (float)(szs - 4)); + // Process Slider Dragging + /// TODO: Optimize + if(RenderD7::Hid::IsEvent("touch", RenderD7::Hid::Held)) { + auto tp = RenderD7::Hid::GetTouchPosition(); + if(UI7::InBox(tp, R7Vec2(sw-10, tsp), R7Vec2(8, szs))) { + ui7_ctx->cm->scrolling_offset = ((tp.y-tsp)/szs)*(ui7_ctx->cm->ms.y-240); + } + } // Calculate Slider Position int slider_pos = tsp +