From c4ae7d82036e8533a52281819ac78a186827515b Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 19 Dec 2019 12:53:37 +0100 Subject: osc: don't run update_margins() every frame This is something recent that also caused per frame log spam, because it tried to update the margins every frame. --- player/lua/osc.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 93da61a759..78686df99b 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -2131,9 +2131,11 @@ function hide_osc() end function osc_visible(visible) - state.osc_visible = visible + if state.osc_visible ~= visible then + state.osc_visible = visible + update_margins() + end request_tick() - update_margins() end function pause_state(name, enabled) -- cgit v1.2.3