diff options
| author | Federico Angelilli <code@fedang.net> | 2024-12-07 00:18:22 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-12-07 00:18:22 +0100 |
| commit | 4f1c110638749f0d6941967e313bdcc28b2b3485 (patch) | |
| tree | 75cb38351fb61e07df0de58c1315b2c5c2df7326 /src/blocks/slider.c | |
| parent | 12cdd6eeb3206a2d7d63d943f82a2e900adefd88 (diff) | |
Refactor event struct
Diffstat (limited to 'src/blocks/slider.c')
| -rw-r--r-- | src/blocks/slider.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |
