mgradwohl / ModernLife

Conway's Game of Life in C++/WinRT/WinAppSDK/WinUI 3
12 stars 3 forks source link

Initial Window Size is not correct #26

Closed mgradwohl closed 1 year ago

mgradwohl commented 1 year ago

On some machines, this code is correct, on others it is not.

       // TODO doesn't work at all monitor DPIs http://microsoft.github.io/Win2D/WinUI3/html/DPI.htm
        const int wndWidth = theCanvas().ConvertDipsToPixels(bestcanvassize + 240, CanvasDpiRounding::Ceiling);
        const int wndHeight = theCanvas().ConvertDipsToPixels(bestcanvassize + 40, CanvasDpiRounding::Ceiling);

        //const int wndWidth = bestcanvassize + 240;
        //const int wndHeight = bestcanvassize + 40;
        appWnd.ResizeClient(Windows::Graphics::SizeInt32{ wndWidth, wndHeight });