diff --git a/src/BizHawk.Client.EmuHawk/Api/Libraries/EmuClientApi.cs b/src/BizHawk.Client.EmuHawk/Api/Libraries/EmuClientApi.cs index 3310d72765..984992fa37 100644 --- a/src/BizHawk.Client.EmuHawk/Api/Libraries/EmuClientApi.cs +++ b/src/BizHawk.Client.EmuHawk/Api/Libraries/EmuClientApi.cs @@ -247,7 +247,7 @@ namespace BizHawk.Client.EmuHawk public void SaveState(string name) => _mainForm.SaveState(Path.Combine(_config.PathEntries.SaveStateAbsolutePath(Game.System), $"{name}.State"), name, fromLua: false); - public int ScreenHeight() => _mainForm.PresentationPanel.NativeSize.Height; + public int ScreenHeight() => _displayManager.GetPanelNativeSize().Height; public void Screenshot(string path) { @@ -257,7 +257,7 @@ namespace BizHawk.Client.EmuHawk public void ScreenshotToClipboard() => _mainForm.TakeScreenshotToClipboard(); - public int ScreenWidth() => _mainForm.PresentationPanel.NativeSize.Width; + public int ScreenWidth() => _displayManager.GetPanelNativeSize().Width; public void SeekFrame(int frame) { diff --git a/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs index 977e61cdf8..c3c353976d 100644 --- a/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs +++ b/src/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs @@ -437,6 +437,8 @@ namespace BizHawk.Client.EmuHawk return new Point((int)v.X, (int)v.Y); } + internal Size GetPanelNativeSize() => presentationPanel.NativeSize; + /// /// This will receive an emulated output frame from an IVideoProvider and run it through the complete frame processing pipeline /// Then it will stuff it into the bound PresentationPanel.