修复windows播放器元素溢出

This commit is contained in:
rang 2025-10-20 17:20:08 +08:00
parent 0b71777b41
commit 699b7de311
5 changed files with 55 additions and 57 deletions

View file

@ -25,8 +25,15 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
FlutterWindow window(project);
Win32Window::Point origin(10, 10);
Win32Window::Size size(1280, 720);
// 居中
UINT windowWidth = 832, windowHeight = 640;
UINT scrWidth, scrHeight, xShaft, yShaft;
scrWidth = GetSystemMetrics(SM_CXFULLSCREEN);
scrHeight = GetSystemMetrics(SM_CYFULLSCREEN);
xShaft = (scrWidth - windowWidth) / 2;
yShaft = (scrHeight - windowHeight) / 2;
Win32Window::Point origin(xShaft, yShaft);
Win32Window::Size size(windowWidth, windowHeight);
if (!window.Create(L"vaani", origin, size)) {
return EXIT_FAILURE;
}