If your display, or if writing a public addon, the user's display, is greater than 1920x1080, you need to do two things:
- Set the CVar scale to 768/height
- Set UIParent's scale to 768/height
This is because WoW won't let you set a CVar scale lower than 0.64 which won't look correct on monitors with a resolution greater than 1080p.
If the height is equal to or less than 1920, only do the first thing. Now here are the hard parts:
- Scale your frame initially by the above scale, in which it will look tiny with unreadable text.
- Increase the height and/or width of the frame until it looks good, but leave the scale alone.
- As mentioned, you need to place your newly scaled frame on an even pixel, unless that isn't centered. You'll have to figure that out frame by frame.
- Assuming you let the user set a scale, which is a bad idea at this point, wrap your "user scale" instead in height or width adjustments providing the illusion of scaling up or down. A better idea is to not provide a scaling option and go straight for height or width.
- Place the adjusted frame again so it sits evenly.