From aa4e2c0ae76df9307cf82bbcb0142b786165085c Mon Sep 17 00:00:00 2001 From: Tig Kindel Date: Tue, 27 Feb 2024 09:51:02 -0700 Subject: [PATCH] FindDeepestView now correctly supports start with Adornments --- Terminal.Gui/View/Layout/ViewLayout.cs | 6 +++--- UnitTests/View/FindDeepestViewTests.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Terminal.Gui/View/Layout/ViewLayout.cs b/Terminal.Gui/View/Layout/ViewLayout.cs index 126754896..7b78a6413 100644 --- a/Terminal.Gui/View/Layout/ViewLayout.cs +++ b/Terminal.Gui/View/Layout/ViewLayout.cs @@ -572,15 +572,15 @@ public partial class View if (findAdornments) { - if (start.Margin.Thickness.Contains (start.Frame, x, y)) + if (start.Margin.Thickness.Contains (start.Margin.Frame, x, y)) { return start.Margin; } - if (start.Border.Thickness.Contains (start.Frame, x, y)) + if (start.Border.Thickness.Contains (start.Border.Frame, x, y)) { return start.Border; } - if (start.Padding.Thickness.Contains (start.Frame, x, y)) + if (start.Padding.Thickness.Contains (start.Padding.Frame, x, y)) { return start.Padding; } diff --git a/UnitTests/View/FindDeepestViewTests.cs b/UnitTests/View/FindDeepestViewTests.cs index e6e2a704b..755ecd30a 100644 --- a/UnitTests/View/FindDeepestViewTests.cs +++ b/UnitTests/View/FindDeepestViewTests.cs @@ -184,7 +184,7 @@ public class FindDeepestViewTests (ITestOutputHelper output) [InlineData (1, 1, typeof (Border))] [InlineData (8, 8, typeof (Border))] - [InlineData (1, 1, typeof (Padding))] + [InlineData (2, 2, typeof (Padding))] [InlineData (7, 7, typeof (Padding))] [InlineData (5, 5, typeof (View))]