Browse Source

move the pos init to constructor

Charlie Kindel 5 years ago
parent
commit
6cac4e5d46
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Terminal.Gui/Core/View.cs

+ 4 - 2
Terminal.Gui/Core/View.cs

@@ -285,8 +285,8 @@ namespace Terminal.Gui {
 			}
 			}
 		}
 		}
 
 
-		Pos x = Pos.At (0);
-		Pos y = Pos.At (0);
+		Pos x, y;
+
 		/// <summary>
 		/// <summary>
 		/// Gets or sets the X position for the view (the column). Only used whe <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/>.
 		/// Gets or sets the X position for the view (the column). Only used whe <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/>.
 		/// </summary>
 		/// </summary>
@@ -383,6 +383,8 @@ namespace Terminal.Gui {
 		{
 		{
 			CanFocus = false;
 			CanFocus = false;
 			LayoutStyle = LayoutStyle.Computed;
 			LayoutStyle = LayoutStyle.Computed;
+			x = Pos.At (0);
+			y = Pos.At (0);
 			Height = 0;
 			Height = 0;
 			Width = 0;
 			Width = 0;
 		}
 		}