Chore: Fix a few more widgets that were breaking dimen refs in

paintTo...
reviewable/pr11367/r1
NiLuJe 3 months ago
parent d33bb0452c
commit 3b129e2ada

@ -94,10 +94,16 @@ end
function FrameContainer:paintTo(bb, x, y)
local my_size = self:getSize()
if not self.dimen then
self.dimen = Geom:new{x = x, y = y, w = my_size.w, h = my_size.h}
self.dimen = Geom:new{
x = x, y = y,
w = my_size.w, h = my_size.h
}
else
self.dimen.x = x
self.dimen.y = y
-- Possibly redundant
self.dimen.w = my_size.w
self.dimen.h = my_size.h
end
local container_width = self.width or my_size.w
local container_height = self.height or my_size.h

@ -72,7 +72,10 @@ function InputContainer:paintTo(bb, x, y)
if not self.dimen then
local content_size = self[1]:getSize()
self.dimen = Geom:new{x = x, y = y, w = content_size.w, h = content_size.h}
self.dimen = Geom:new{
x = x, y = y,
w = content_size.w, h = content_size.h
}
else
self.dimen.x = x
self.dimen.y = y

@ -27,11 +27,19 @@ end
function UnderlineContainer:paintTo(bb, x, y)
local container_size = self:getSize()
self.dimen = Geom:new{
x = x, y = y,
w = container_size.w,
h = container_size.h
}
if not self.dimen then
self.dimen = Geom:new{
x = x, y = y,
w = container_size.w,
h = container_size.h
}
else
self.dimen.x = x
self.dimen.y = y
-- Possibly redundant
self.dimen.w = container_size.w
self.dimen.h = container_size.h
end
local content_size = self[1]:getSize()
local p_y = y
if self.vertical_align == "center" then

@ -515,11 +515,19 @@ function ImageWidget:paintTo(bb, x, y)
if self.hide then return end
-- self:_render is called in getSize method
local size = self:getSize()
self.dimen = Geom:new{
x = x, y = y,
w = size.w,
h = size.h
}
if not self.dimen then
self.dimen = Geom:new{
x = x, y = y,
w = size.w,
h = size.h
}
else
self.dimen.x = x
self.dimen.y = y
-- Possibly redundant
self.dimen.w = size.w
self.dimen.h = size.h
end
logger.dbg("blitFrom", x, y, self._offset_x, self._offset_y, size.w, size.h)
local do_alpha = false
if self.alpha == true then

@ -110,11 +110,19 @@ end
function ProgressWidget:paintTo(bb, x, y)
local my_size = self:getSize()
self.dimen = Geom:new{
x = x, y = y,
w = my_size.w,
h = my_size.h
}
if not self.dimen then
self.dimen = Geom:new{
x = x, y = y,
w = my_size.w,
h = my_size.h
}
else
self.dimen.x = x
self.dimen.y = y
-- Possibly redundant
self.dimen.w = my_size.w
self.dimen.h = my_size.h
end
if self.dimen.w == 0 or self.dimen.h == 0 then return end
local _mirroredUI = BD.mirroredUILayout()

@ -310,8 +310,8 @@ function VirtualKey:init()
self.flash_keyboard = G_reader_settings:nilOrTrue("flash_keyboard")
end
function VirtualKey:paintTo(bb, x ,y)
InputContainer.paintTo(self, bb, x, y)
function VirtualKey:paintTo(...)
InputContainer.paintTo(self, ...)
-- Fudge self.dimen to include the padding, to make sure said padding is covered by our ges_events range...
-- Like Geom, floor coordinates & ceil dims, to fill the gaps without overlaps.

Loading…
Cancel
Save