Esempio n. 1
0
        public static void Initialize()
        {
            if (PlatformUtils.IsMobile)
            {
                var density = PlatformUtils.GetPixelDensity();

                if (Settings.DpiScaling != 0)
                {
                    mainWindowScaling = Settings.DpiScaling / 100.0f;
                }
                else
                {
                    if (density < 360)
                    {
                        mainWindowScaling = 0.666f;
                    }
                    else if (density >= 480)
                    {
                        mainWindowScaling = 1.333f;
                    }
                    else
                    {
                        mainWindowScaling = 1.0f;
                    }
                }

                dialogScaling     = 1;
                fontScaling       = (float)Math.Round(mainWindowScaling * 3);
                mainWindowScaling = (float)Math.Round(mainWindowScaling * 6);
            }
            else
            {
                dialogScaling = PlatformUtils.GetDesktopScaling();

                if (Settings.DpiScaling != 0)
                {
                    mainWindowScaling = RoundScaling(Settings.DpiScaling / 100.0f);
                }
                else
                {
                    mainWindowScaling = RoundScaling(dialogScaling);
                }

                fontScaling = mainWindowScaling;
            }

            initialized = true;
        }