NumberPickerWidget: keep size in rotation

pull/8213/head^2
hius07 3 years ago committed by Frans de Jonge
parent c40874d300
commit 66156084e6

@ -53,9 +53,7 @@ local NumberPickerWidget = InputContainer:new{
function NumberPickerWidget:init()
self.screen_width = Screen:getWidth()
self.screen_height = Screen:getHeight()
if self.width == nil then
self.width = math.floor(self.screen_width * 0.2)
end
self.width = self.width or math.floor(math.min(self.screen_width, self.screen_height) * 0.2)
if self.value_table then
self.value_index = self.value_index or 1
self.value = self.value_table[self.value_index]

Loading…
Cancel
Save