From 5d6807620f89f2dc367aec93a999713ff9ac802b Mon Sep 17 00:00:00 2001 From: poire-z Date: Fri, 9 Nov 2018 21:44:00 +0100 Subject: [PATCH] Fix footnote size after screen rotation (#4316) --- frontend/ui/widget/footnotewidget.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/ui/widget/footnotewidget.lua b/frontend/ui/widget/footnotewidget.lua index b07843534..af91db8e6 100644 --- a/frontend/ui/widget/footnotewidget.lua +++ b/frontend/ui/widget/footnotewidget.lua @@ -103,8 +103,6 @@ local FootnoteWidget = InputContainer:new{ top = Screen:scaleBySize(10), bottom = Screen:scaleBySize(10), }, - width = Screen:getWidth(), - height = math.floor(Screen:getHeight() * 1/3), -- will be decreased when content is smaller follow_callback = nil, on_tap_close_callback = nil, close_callback = nil, @@ -112,6 +110,10 @@ local FootnoteWidget = InputContainer:new{ } function FootnoteWidget:init() + -- Set widget size + self.width = Screen:getWidth() + self.height = math.floor(Screen:getHeight() * 1/3) -- will be decreased when content is smaller + if Device:isTouchDevice() then local range = Geom:new{ x = 0, y = 0,