core/menusystem: update view just before drawing to avoid glitch
This commit is contained in:
parent
ded24ede27
commit
ce5b4ea20b
2 changed files with 4 additions and 0 deletions
|
@ -151,6 +151,7 @@ function FlowBox:mousepressed(x, y, button, isTouch)
|
||||||
end
|
end
|
||||||
|
|
||||||
function FlowBox:draw()
|
function FlowBox:draw()
|
||||||
|
self:updateView()
|
||||||
local widgety = self.y
|
local widgety = self.y
|
||||||
local widgetx = self.x
|
local widgetx = self.x
|
||||||
for i,v in ipairs(self.widget.list) do
|
for i,v in ipairs(self.widget.list) do
|
||||||
|
@ -171,6 +172,7 @@ function FlowBox:draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
function FlowBox:drawCursor()
|
function FlowBox:drawCursor()
|
||||||
|
self:updateView()
|
||||||
local begincol, beginline = self:getCoord(self.view.firstSlot)
|
local begincol, beginline = self:getCoord(self.view.firstSlot)
|
||||||
if (self.widget.selected >= 1 and self.widget.selected <= #self.widget.list) then
|
if (self.widget.selected >= 1 and self.widget.selected <= #self.widget.list) then
|
||||||
local w, h = self:getWidgetSize()
|
local w, h = self:getWidgetSize()
|
||||||
|
|
|
@ -77,6 +77,7 @@ function ListBox:mousepressed(x, y, button, isTouch)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ListBox:draw()
|
function ListBox:draw()
|
||||||
|
self:updateView()
|
||||||
local widgety = self.y
|
local widgety = self.y
|
||||||
for i,v in ipairs(self.widget.list) do
|
for i,v in ipairs(self.widget.list) do
|
||||||
if (i >= self.view.firstSlot) and (i < self.view.firstSlot + self.view.slotNumber) then
|
if (i >= self.view.firstSlot) and (i < self.view.firstSlot + self.view.slotNumber) then
|
||||||
|
@ -92,6 +93,7 @@ function ListBox:draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
function ListBox:drawCursor()
|
function ListBox:drawCursor()
|
||||||
|
self:updateView()
|
||||||
if (self.widget.selected >= 1 and self.widget.selected <= #self.widget.list) then
|
if (self.widget.selected >= 1 and self.widget.selected <= #self.widget.list) then
|
||||||
local w, h = self:getWidgetSize()
|
local w, h = self:getWidgetSize()
|
||||||
local y = (self.widget.selected - self.view.firstSlot) * h
|
local y = (self.widget.selected - self.view.firstSlot) * h
|
||||||
|
|
Loading…
Reference in a new issue