From 2084edafb43d3fe0f805b3bf009a7774560df0dc Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Wed, 28 Jan 2015 10:01:48 +0100 Subject: [PATCH] Fix dev tools hack. This fixes the problem hacked around in 41fe7e28aa10e7a1a213c7b57a77ff5fe09c85cf. In the end the problem wasn't ScrollViewer, it was that the correct size wasn't being passed to Window.Arrange. --- Perspex.Diagnostics/DevTools.cs | 6 ++---- Perspex.Layout/LayoutManager.cs | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Perspex.Diagnostics/DevTools.cs b/Perspex.Diagnostics/DevTools.cs index da0c4bd3be..8f80c8a30d 100644 --- a/Perspex.Diagnostics/DevTools.cs +++ b/Perspex.Diagnostics/DevTools.cs @@ -118,10 +118,8 @@ namespace Perspex.Diagnostics { Window window = new Window { - // HACK: Set width and height here as a quick fix as there's a problem with - // the dev tools window hanging when it's set to auto-size. - Width = 800, - Height = 600, + Width = 1024, + Height = 512, Content = new DevTools { Root = (Window)sender, diff --git a/Perspex.Layout/LayoutManager.cs b/Perspex.Layout/LayoutManager.cs index 864370d2c1..f08ca7bf50 100644 --- a/Perspex.Layout/LayoutManager.cs +++ b/Perspex.Layout/LayoutManager.cs @@ -206,9 +206,9 @@ namespace Perspex.Layout this.toArrange = new Heap(HeapType.Minimum); - if (!this.Root.IsArrangeValid) + if (!this.Root.IsArrangeValid && this.Root.IsMeasureValid) { - this.Root.Arrange(new Rect(this.Root.ClientSize)); + this.Root.Arrange(new Rect(this.Root.DesiredSize.Value)); } if (this.toMeasure.Count > 0)