core/menusystem: update view just before drawing to avoid glitch

This commit is contained in:
Kazhnuz 2019-02-13 18:06:58 +01:00
parent ded24ede27
commit ce5b4ea20b
2 changed files with 4 additions and 0 deletions

View file

@ -151,6 +151,7 @@ function FlowBox:mousepressed(x, y, button, isTouch)
end
function FlowBox:draw()
self:updateView()
local widgety = self.y
local widgetx = self.x
for i,v in ipairs(self.widget.list) do
@ -171,6 +172,7 @@ function FlowBox:draw()
end
function FlowBox:drawCursor()
self:updateView()
local begincol, beginline = self:getCoord(self.view.firstSlot)
if (self.widget.selected >= 1 and self.widget.selected <= #self.widget.list) then
local w, h = self:getWidgetSize()

View file

@ -77,6 +77,7 @@ function ListBox:mousepressed(x, y, button, isTouch)
end
function ListBox:draw()
self:updateView()
local widgety = self.y
for i,v in ipairs(self.widget.list) do
if (i >= self.view.firstSlot) and (i < self.view.firstSlot + self.view.slotNumber) then
@ -92,6 +93,7 @@ function ListBox:draw()
end
function ListBox:drawCursor()
self:updateView()
if (self.widget.selected >= 1 and self.widget.selected <= #self.widget.list) then
local w, h = self:getWidgetSize()
local y = (self.widget.selected - self.view.firstSlot) * h