fix: drag seeking crashing the UI during file loads

closes #305
This commit is contained in:
tomasklaen
2022-10-08 09:32:11 +02:00
parent e94f9bf290
commit a942a932c6

View File

@@ -2803,8 +2803,10 @@ end
---@param fast? boolean ---@param fast? boolean
function Timeline:set_from_cursor(fast) function Timeline:set_from_cursor(fast)
if state.time and state.duration then
mp.commandv('seek', self:get_time_at_x(cursor.x), fast and 'absolute+keyframes' or 'absolute+exact') mp.commandv('seek', self:get_time_at_x(cursor.x), fast and 'absolute+keyframes' or 'absolute+exact')
end end
end
function Timeline:clear_thumbnail() mp.commandv('script-message-to', 'thumbfast', 'clear') end function Timeline:clear_thumbnail() mp.commandv('script-message-to', 'thumbfast', 'clear') end
function Timeline:on_mbtn_left_down() function Timeline:on_mbtn_left_down()