Some in-gui scaling code.