I was failing earlier when the aspect ratio was close to square. Like with the default resolution of a LÖVE window on a computer :/ Thanks Ivan Reese for the report.
LUYWR2DLKU5HA5LEY5ZW6BKL5WEWJREBN5WL4C7XPYECD7LUP3VQC side = min(w/(lw+6), h/(lh+6)) -- leave some margin for buttons
local w1, w2 = landscape_button_offsets()local h1, h2 = portrait_button_offsets()if Safe_width > Safe_height thenside = min((w-w1-w2)/(1+lw+1+6), h/(lh+6)) -- leave 1 side between board and buttonselseside = min(w/(lw+6), (h-h1-h2)/(1+lh+1+6)) -- leave 1 side between board and buttonsend
bside = min(left, top)
if Safe_width > Safe_height thenbside = min((w-w1-w2-side*(1+lw+1))/2, (h-side*lh)/2)elsebside = min((h-h1-h2-side*(1+lh+1))/2, (w-side*lw)/2)endend-- space needed for buttons to the left and rightfunction landscape_button_offsets()local ns, ps = tostring('>>'), tostring('<<')local nw, pw = App.width(ns)+10, App.width(ps)+10return 10+pw+10, 10+nw+10-- we assume the level name and undo button will be within this widthend-- space needed for buttons to the top and bottomfunction portrait_button_offsets()return 10+Line_height+10, 10+Line_height+10