dynamic maxDropdown to make dropdowns take up at most 0.75x of your screen
This commit is contained in:
parent
bc0bf26289
commit
700e01cc1d
1 changed files with 2 additions and 0 deletions
|
@ -200,6 +200,8 @@ function self.createDropdowns()
|
||||||
end
|
end
|
||||||
|
|
||||||
function self.update(dt)
|
function self.update(dt)
|
||||||
|
maxDropdown = math.floor(math.min(16 * (margin + fontHeight), love.graphics.getHeight() * 0.75) / (margin + fontHeight))
|
||||||
|
|
||||||
if self.openDropdown ~= 0 then
|
if self.openDropdown ~= 0 then
|
||||||
dropdownScroll = math.max(dropdownScroll, -(#self.get(self.openDropdown).options - maxDropdown + 1))
|
dropdownScroll = math.max(dropdownScroll, -(#self.get(self.openDropdown).options - maxDropdown + 1))
|
||||||
dropdownScroll = math.min(dropdownScroll, 0)
|
dropdownScroll = math.min(dropdownScroll, 0)
|
||||||
|
|
Loading…
Reference in a new issue