From ee0fc06b9a96b6eb536cba6d05cb90d6a1eb6353 Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 28 Dec 2020 00:29:33 +0000 Subject: [PATCH] Fixes #1061. ComputerLayout scenario does not drawn correctly. --- Terminal.Gui/Core/Window.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Terminal.Gui/Core/Window.cs b/Terminal.Gui/Core/Window.cs index aac079b57..5997f3f41 100644 --- a/Terminal.Gui/Core/Window.cs +++ b/Terminal.Gui/Core/Window.cs @@ -184,6 +184,7 @@ namespace Terminal.Gui { contentView.Redraw (contentView.Bounds); Driver.Clip = savedClip; + ClearLayoutNeeded (); ClearNeedsDisplay (); Driver.SetAttribute (ColorScheme.Normal); Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: false); @@ -246,8 +247,12 @@ namespace Terminal.Gui { dragPosition = new Point (nx, ny); LayoutSubviews (); Frame = new Rect (nx, ny, Frame.Width, Frame.Height); - X = nx; - Y = ny; + if (X == null || X is Pos.PosAbsolute) { + X = nx; + } + if (Y == null || Y is Pos.PosAbsolute) { + Y = ny; + } //System.Diagnostics.Debug.WriteLine ($"nx:{nx},ny:{ny}"); // FIXED: optimize, only SetNeedsDisplay on the before/after regions.