Prechádzať zdrojové kódy

Invert the condition.

BDisp 4 rokov pred
rodič
commit
d1b99b7c9a
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      Terminal.Gui/Views/Button.cs

+ 3 - 3
Terminal.Gui/Views/Button.cs

@@ -145,11 +145,11 @@ namespace Terminal.Gui {
 				base.Text = ustring.Make (_leftBracket) + " " + text + " " + ustring.Make (_rightBracket);
 
 			int w = base.Text.RuneCount - (base.Text.Contains (HotKeySpecifier) ? 1 : 0);
-			if (!(Width is Dim.DimCombine)) {
-				Width = w;
-			} else {
+			if (Width is Dim.DimCombine) {
 				// It's a Dim.DimCombine and so can't be assigned. Let it have it's own anchor.
 				w = Width.Anchor (w);
+			} else {
+				Width = w;
 			}
 			Height = 1;
 			Frame = new Rect (Frame.Location, new Size (w, 1));