layout(
w,h,cw,ch) ->k,dx,dy
Compute the integer-upscale layout of a canvas in a window
The console's layout (gfx.display), with one difference: a window
smaller than the canvas gets scale 1 and negative offsets, and crops the
canvas centred. A WM may hand a window any size, and the display draws
whatever it is given.