|
|
|
@ -8,11 +8,19 @@ local CenterContainer = WidgetContainer:new()
|
|
|
|
|
|
|
|
|
|
function CenterContainer:paintTo(bb, x, y)
|
|
|
|
|
local content_size = self[1]:getSize()
|
|
|
|
|
--- @fixme
|
|
|
|
|
-- if content_size.w > self.dimen.w or content_size.h > self.dimen.h then
|
|
|
|
|
-- throw error? paint to scrap buffer and blit partially?
|
|
|
|
|
-- for now, we ignore this
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
-- check if content is bigger than container
|
|
|
|
|
if self.ignore_if_over == "height" then -- align upper borders
|
|
|
|
|
if self.dimen.h < content_size.h then
|
|
|
|
|
self.ignore = "height"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if self.ignore_if_over == "width" then -- align left borders
|
|
|
|
|
if self.dimen.w < content_size.w then
|
|
|
|
|
self.ignore = "width"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local x_pos = x
|
|
|
|
|
local y_pos = y
|
|
|
|
|
if self.ignore ~= "height" then
|
|
|
|
|