Skip to content

Commit

Permalink
UI: Prevent window from being auto-resized to a scale below 1x
Browse files Browse the repository at this point in the history
  • Loading branch information
SourMesen committed Feb 11, 2025
1 parent 5422619 commit ea7aa40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion UI/Windows/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ private void ProcessResolutionChange()

public void SetScale(double scale)
{
if(scale < 1) {
scale = 1;
}

//TODOv2 - Calling this twice seems to fix what might be an issue in Avalonia?
//On the first call, when DPI > 100%, sometimes _rendererPanel's bounds are incorrect
InternalSetScale(scale);
Expand All @@ -475,7 +479,6 @@ private void InternalSetScale(double scale)
if(WindowState == WindowState.Normal) {
_rendererSize = new Size();


//When menu is set to auto-hide, don't count its height when calculating the window's final size
double menuHeight = ConfigManager.Config.Preferences.AutoHideMenu ? 0 : _mainMenu.Bounds.Height;

Expand Down

0 comments on commit ea7aa40

Please sign in to comment.