How does scaling work for skins?

OK, I have a skin which has a definition for 1920×1080 screens (similar to Estuary) and it all runs quite happily on devices which have differing resolutions and aspect ratios. Such as:
– iPad 2, 1024×768, 4:3
– Surface Pro 3, 2440×16-something, 3:2

All fine except for one thing: coordinates in a python script, in which I want to put something X pixels up from the bottom (scaled to suit the screen).
It needs to work in with other XML controls.

I notice that window.getWidth and getHeight return the native screen sizes unscaled. So I can’t use those. But if I use 1080 for the height, hoping that it will get scaled along with everything else, that doesn’t work either: things end up about 3/4 of the way down the screen, and I suspect it is the different aspect ratios to blame.

Does automatic scaling work on the width alone? How does Kodi scale skins when the aspect ratios are very different?