Fix #50: window moved unexpectedly when new size is smaller than min size

This commit is contained in:
Paddy Xu
2017-08-01 23:44:52 +03:00
parent 3994039864
commit bf2f0f5ad7

View File

@@ -160,6 +160,10 @@ namespace QuickLook
private void ResizeAndCenter(Size size)
{
// resize to MinSize first
size.Width = Math.Max(size.Width, MinWidth);
size.Height = Math.Max(size.Height, MinHeight);
if (!IsLoaded)
{
// if the window is not loaded yet, just leave the problem to WPF