From 4f1c110638749f0d6941967e313bdcc28b2b3485 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Sat, 7 Dec 2024 00:18:22 +0100 Subject: Refactor event struct --- src/blocks/slider.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/blocks/slider.c') diff --git a/src/blocks/slider.c b/src/blocks/slider.c index 854b284..f4a9ad0 100644 --- a/src/blocks/slider.c +++ b/src/blocks/slider.c @@ -191,7 +191,7 @@ static void block_slider_event(layout_t *layout, config_t *config, event_t event int bar_height = slider->height; // NOTE: Consider disabling these actions for non seekable sliders - bool clicked = check_capsule(event.x, event.y, bar_x, bar_y, bar_width, bar_height); + bool clicked = check_capsule(event.mouse.x, event.mouse.y, bar_x, bar_y, bar_width, bar_height); action_t *action = layout->block->actions[event.type]; switch (event.type) { @@ -217,7 +217,7 @@ static void block_slider_event(layout_t *layout, config_t *config, event_t event action_perform(action, layout->block, config); if (slider->seekable && clicked) - slider->value = 100 * (event.x - bar_x) / (double)(bar_width - 1); + slider->value = 100 * (event.mouse.x - bar_x) / (double)(bar_width - 1); } else { action_perform(layout->block->actions[event.type], layout->block, config); -- cgit v1.2.3