浏览代码

Fixed cell selection when clicking near cell border

tznind 4 年之前
父节点
当前提交
448bc3af3b
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Terminal.Gui/Views/TableView.cs

+ 5 - 1
Terminal.Gui/Views/TableView.cs

@@ -617,8 +617,12 @@ namespace Terminal.Gui {
 				
 				var headerHeight = ShouldRenderHeaders()? GetHeaderHeight():0;
 
-				var col = viewPort.LastOrDefault(c=>c.X < me.OfX);
+				var col = viewPort.LastOrDefault(c=>c.X <= me.OfX);
 				
+				// Click is on the header section of rendered UI
+				if(me.OfY < headerHeight)
+					return false;
+
 				var rowIdx = RowOffset - headerHeight + me.OfY;
 
 				if(col != null && rowIdx >= 0) {