From ded24ede27c01dba2b100dbb7548607d34d48ea7 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 13 Feb 2019 18:04:27 +0100 Subject: [PATCH] core/menusystem: put the view update in its own function --- sonic-boost.love/core/modules/menusystem/flowbox.lua | 4 ++++ sonic-boost.love/core/modules/menusystem/listbox.lua | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sonic-boost.love/core/modules/menusystem/flowbox.lua b/sonic-boost.love/core/modules/menusystem/flowbox.lua index aa55788..9cec3a2 100644 --- a/sonic-boost.love/core/modules/menusystem/flowbox.lua +++ b/sonic-boost.love/core/modules/menusystem/flowbox.lua @@ -25,6 +25,10 @@ function FlowBox:updateWidgetSize() end function FlowBox:update(dt) + self:updateView() +end + +function FlowBox:updateView() local col, line = self:getCoord(self.widget.selected) local begincol, beginline = self:getCoord(self.view.firstSlot) diff --git a/sonic-boost.love/core/modules/menusystem/listbox.lua b/sonic-boost.love/core/modules/menusystem/listbox.lua index 3234963..0d679ec 100644 --- a/sonic-boost.love/core/modules/menusystem/listbox.lua +++ b/sonic-boost.love/core/modules/menusystem/listbox.lua @@ -20,6 +20,10 @@ function ListBox:updateWidgetSize() end function ListBox:update(dt) + self:updateView() +end + +function ListBox:updateView() if self.widget.selected < self.view.firstSlot then self.view.firstSlot = self.widget.selected end