Browse Source

The recent fix also applies to the - operator

miguel 5 years ago
parent
commit
623e67692c
1 changed files with 5 additions and 2 deletions
  1. 5 2
      Terminal.Gui/Types/PosDim.cs

+ 5 - 2
Terminal.Gui/Types/PosDim.cs

@@ -224,8 +224,11 @@ namespace Terminal.Gui {
 		public static Pos operator - (Pos left, Pos right)
 		{
 			PosCombine newPos = new PosCombine (false, left, right);
-			if (posCombine?.ToString () != newPos.ToString ())
-				((PosView)left).Target.SetNeedsLayout ();
+			if (posCombine?.ToString () != newPos.ToString ()) {
+				var view = left as PosView;
+				if (view != null)
+					view.Target.SetNeedsLayout ();
+			}
 			return posCombine = newPos;
 		}