Skip to content

Commit

Permalink
fix: use primary_click for chapter indicators (#932)
Browse files Browse the repository at this point in the history
Listening to `primary_down`, but not listening to the `primary_up` event
leads to that `up` event getting forwarded. Listening to `primary_click`
instead avoids that problem.

Seeking chapters now happens on button up instead of button down, but
that shouldn't be a problem for anyone and makes their behavior
consistent with other clickable UI elements.

ref. #931
  • Loading branch information
christoph-heinrich authored Jul 12, 2024
1 parent c660db0 commit 9fa7220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uosc/elements/Timeline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function Timeline:render()
if chapter ~= hovered_chapter then draw_chapter(chapter.time, diamond_radius) end
local circle = {point = {x = t2x(chapter.time), y = fay - 1}, r = diamond_radius_hovered}
if visibility > 0 then
cursor:zone('primary_down', circle, function()
cursor:zone('primary_click', circle, function()
mp.commandv('seek', chapter.time, 'absolute+exact')
end)
end
Expand Down

0 comments on commit 9fa7220

Please # to comment.