fix: overlay scaling issue

This commit is contained in:
pa
2025-12-13 23:44:24 +09:00
committed by Natsumi
parent 728434f336
commit ae1cf134cc
5 changed files with 47 additions and 14 deletions

View File

@@ -24,17 +24,26 @@ namespace VRCX
private int _width;
private int _height;
public OffScreenBrowserLegacy(string address, int width, int height)
: base(
address,
new BrowserSettings()
{
DefaultEncoding = "UTF-8"
}
)
public OffScreenBrowserLegacy(string address, int width, int height, IRequestContext requestContext = null)
: base(address, automaticallyCreateBrowser: false)
{
_paintBufferLock = new ReaderWriterLockSlim();
var windowInfo = new WindowInfo();
windowInfo.SetAsWindowless(IntPtr.Zero);
windowInfo.WindowlessRenderingEnabled = true;
windowInfo.SharedTextureEnabled = false;
windowInfo.Width = width;
windowInfo.Height = height;
var browserSettings = new BrowserSettings()
{
DefaultEncoding = "UTF-8",
WindowlessFrameRate = 24
};
CreateBrowser(windowInfo, browserSettings, requestContext);
Size = new System.Drawing.Size(width, height);
RenderHandler = this;