Add Beta Slider Dragging

This commit is contained in:
tobid7 2024-06-26 08:57:08 +02:00
parent 586134787c
commit 0b981f9b4d

View File

@ -448,6 +448,14 @@ void UI7CtxEndMenu() {
static_cast<float>(ui7_ctx->cm->ms.y)); static_cast<float>(ui7_ctx->cm->ms.y));
// Create Real Slider Height // Create Real Slider Height
int slider_rh = d7min(d7max(slider_h, (float)lszs), (float)(szs - 4)); 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 // Calculate Slider Position
int slider_pos = int slider_pos =
tsp + tsp +