Skip to content

Commit

Permalink
Fixes #161 by respecting MaxWidth and MaxHeight of Window
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Aug 26, 2015
1 parent 76077ae commit 44e6825
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Fluent/Internal/WindowSizing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ private MINMAXINFO GetMinMaxInfo(IntPtr hwnd, MINMAXINFO mmi)

var x = ignoreTaskBar ? monitorInfo.rcMonitor.left : monitorInfo.rcWork.left;
var y = ignoreTaskBar ? monitorInfo.rcMonitor.top : monitorInfo.rcWork.top;
mmi.ptMaxSize.X = ignoreTaskBar ? Math.Abs(monitorInfo.rcMonitor.right - x) : Math.Abs(monitorInfo.rcWork.right - x);
mmi.ptMaxSize.Y = ignoreTaskBar ? Math.Abs(monitorInfo.rcMonitor.bottom - y) : Math.Abs(monitorInfo.rcWork.bottom - y);
var maxWidth = ignoreTaskBar ? Math.Abs(monitorInfo.rcMonitor.right - x) : Math.Abs(monitorInfo.rcWork.right - x);
var maxHeight = ignoreTaskBar ? Math.Abs(monitorInfo.rcMonitor.bottom - y) : Math.Abs(monitorInfo.rcWork.bottom - y);

mmi.ptMaxSize.X = Math.Min(maxWidth, (int)this.window.MaxWidth);
mmi.ptMaxSize.Y = Math.Min(maxHeight, (int)this.window.MaxHeight);

if (!ignoreTaskBar)
{
Expand Down

0 comments on commit 44e6825

Please sign in to comment.