diff --git a/src/Misc/MainForm.cs b/src/Misc/MainForm.cs index c405465..879434b 100644 --- a/src/Misc/MainForm.cs +++ b/src/Misc/MainForm.cs @@ -72,6 +72,8 @@ namespace mpvnet Core.ObservePropertyInt("edition", PropChangeEdition); + Core.ObservePropertyDouble("window-scale", WindowScale); + if (Core.GPUAPI != "vulkan") Core.ProcessCommandLine(false); @@ -163,6 +165,19 @@ namespace mpvnet })); } + void WindowScale(double scale) + { + if (!WasShown) + return; + + BeginInvoke(new Action(() => { + SetSize( + (int)(Core.VideoSize.Width * scale), + (int)Math.Ceiling(Core.VideoSize.Height * scale), + Screen.FromControl(this), false); + })); + } + void Core_Shutdown() => BeginInvoke(new Action(() => Close())); void Core_Idle() => SetTitle();