Skip to content
Snippets Groups Projects
Commit 12f0e284 authored by Alex Ksandra's avatar Alex Ksandra
Browse files

Even more calculations, woo!

parent ad089c8e
No related branches found
No related tags found
No related merge requests found
...@@ -457,11 +457,23 @@ function _M:setupUI(resizex, resizey, on_resize, addmw, addmh) ...@@ -457,11 +457,23 @@ function _M:setupUI(resizex, resizey, on_resize, addmw, addmh)
local regenerate = false local regenerate = false
if ui.calc_width then if ui.calc_width then
ui.ui.w = self.iw - (ui.right + ui.left) if ui.left and ui.right then
ui.ui.w = self.iw - (ui.right + ui.left)
elseif ui.left and ui.hcenter then
ui.ui.w = self.iw + 2 * (ui.hcenter - ui.left)
elseif ui.hcenter and ui.right then
ui.ui.w = self.iw + 2 * (-ui.hcenter - ui.right)
end
regenerate = true regenerate = true
end end
if ui.calc_height then if ui.calc_height then
ui.ui.h = self.ih - (ui.top + ui.bottom) if ui.top and ui.bottom then
ui.ui.h = self.ih - (ui.bottom + ui.top)
elseif ui.top and ui.vcenter then
ui.ui.h = self.ih + 2 * (ui.vcenter - ui.top)
elseif ui.vcenter and ui.bottom then
ui.ui.h = self.ih + 2 * (-ui.vcenter - ui.bottom)
end
regenerate = true regenerate = true
end end
if regenerate then if regenerate then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment