Skip to content

Commit

Permalink
Add separate variable for initial window size
Browse files Browse the repository at this point in the history
  • Loading branch information
veger committed Jun 17, 2024
1 parent 05fa2be commit 878489d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Yafc.UI/Core/WindowMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ protected void Create(string title, int display) {
pixelsPerUnit = CalculateUnitsToPixels(display);
int minWidth = MathUtils.Round(85f * pixelsPerUnit);
int minHeight = MathUtils.Round(60f * pixelsPerUnit);
int initialWidth = MathUtils.Round(85f * pixelsPerUnit);
int initialHeight = MathUtils.Round(60f * pixelsPerUnit);
window = SDL.SDL_CreateWindow(title,
SDL.SDL_WINDOWPOS_CENTERED_DISPLAY(display),
SDL.SDL_WINDOWPOS_CENTERED_DISPLAY(display),
minWidth, minHeight,
initialWidth, initialHeight,
SDL.SDL_WindowFlags.SDL_WINDOW_RESIZABLE | (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? 0 : SDL.SDL_WindowFlags.SDL_WINDOW_OPENGL)
);
SDL.SDL_SetWindowMinimumSize(window, minWidth, minHeight);
Expand Down

0 comments on commit 878489d

Please sign in to comment.