Explorar el Código

Fixed cell selection when clicking near cell border

tznind hace 4 años
padre
commit
448bc3af3b
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  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) {