From f1e4e21456cbae60581e9205b3cac7cd212b956b Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 5 Mar 2023 18:32:14 +0000 Subject: [PATCH] Removing and refactoring code. --- Terminal.Gui/Core/View.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Terminal.Gui/Core/View.cs b/Terminal.Gui/Core/View.cs index 04c3dc9ad..eb8907c3d 100644 --- a/Terminal.Gui/Core/View.cs +++ b/Terminal.Gui/Core/View.cs @@ -808,7 +808,6 @@ namespace Terminal.Gui { { var actX = x is Pos.PosAbsolute ? x.Anchor (0) : frame.X; var actY = y is Pos.PosAbsolute ? y.Anchor (0) : frame.Y; - Rect oldFrame = frame; if (AutoSize) { var s = GetAutoSize (); @@ -1359,10 +1358,10 @@ namespace Terminal.Gui { public virtual void OnAdded (View view) { view.IsAdded = true; - view.x = view.x ?? view.frame.X; - view.y = view.y ?? view.frame.Y; - view.width = view.width ?? view.frame.Width; - view.height = view.height ?? view.frame.Height; + view.x ??= view.frame.X; + view.y ??= view.frame.Y; + view.width ??= view.frame.Width; + view.height ??= view.frame.Height; view.Added?.Invoke (this); }