Browse Source

Invert the if for even less nesting

Brandon Thetford 1 year ago
parent
commit
282c434fda
1 changed files with 15 additions and 15 deletions
  1. 15 15
      Terminal.Gui/Application.cs

+ 15 - 15
Terminal.Gui/Application.cs

@@ -1601,25 +1601,25 @@ public static partial class Application
 
         bool AdornmentHandledMouseEvent (Adornment? frame)
         {
-            if (frame?.Thickness.Contains (frame.FrameToScreen (), a.MouseEvent.X, a.MouseEvent.Y) is true)
+            if (frame?.Thickness.Contains (frame.FrameToScreen (), a.MouseEvent.X, a.MouseEvent.Y) is not true)
             {
-                Point boundsPoint = frame.ScreenToBounds (a.MouseEvent.X, a.MouseEvent.Y);
+                return false;
+            }
 
-                var me = new MouseEvent
-                {
-                    X = boundsPoint.X,
-                    Y = boundsPoint.Y,
-                    Flags = a.MouseEvent.Flags,
-                    OfX = boundsPoint.X,
-                    OfY = boundsPoint.Y,
-                    View = frame
-                };
-                frame.OnMouseEvent (me);
+            Point boundsPoint = frame.ScreenToBounds (a.MouseEvent.X, a.MouseEvent.Y);
 
-                return true;
-            }
+            var me = new MouseEvent
+            {
+                X = boundsPoint.X,
+                Y = boundsPoint.Y,
+                Flags = a.MouseEvent.Flags,
+                OfX = boundsPoint.X,
+                OfY = boundsPoint.Y,
+                View = frame
+            };
+            frame.OnMouseEvent (me);
 
-            return false;
+            return true;
         }
 
         static bool OutsideRect (Point p, Rectangle r) { return p.X < 0 || p.X > r.Right || p.Y < 0 || p.Y > r.Bottom; }