@@ -1047,21 +1047,12 @@ protected override void OnMouseMove(MouseEventArgs e)
10471047
10481048 Cell newCell = CalculatePointedCell ( _currentX . Value , _currentY . Value ) ;
10491049
1050- if ( ! newCell . Equals ( CurrentCell ) )
1050+ bool changed = CellChanged ( newCell ) ;
1051+ if ( changed && ( ShowColumnTextOnHover || IsHoveringOnColumnCell || WasHoveringOnColumnCell ) )
10511052 {
1052- CellChanged ( newCell ) ;
1053-
1054- if ( IsHoveringOnColumnCell
1055- || ( WasHoveringOnColumnCell && ! IsHoveringOnColumnCell ) )
1056- {
1057- Refresh ( ) ;
1058- }
1059- else if ( _columnDown != null )
1060- {
1061- Refresh ( ) ;
1062- }
1053+ Refresh ( ) ;
10631054 }
1064- else if ( _columnDown != null ) // Kind of silly feeling to have this check twice, but the only alternative I can think of has it refreshing twice when pointed column changes with column down, and speed matters
1055+ else if ( _columnDown != null )
10651056 {
10661057 Refresh ( ) ;
10671058 }
@@ -1588,13 +1579,15 @@ private void OrientationChanged()
15881579 /// <summary>
15891580 /// Call this function to change the CurrentCell to newCell
15901581 /// </summary>
1591- private void CellChanged ( Cell newCell )
1582+ /// <returns>true if CurrentCell was changed</returns>
1583+ private bool CellChanged ( Cell newCell )
15921584 {
1585+ if ( newCell == CurrentCell ) return false ;
1586+
15931587 _lastCell = CurrentCell ;
15941588 CurrentCell = newCell ;
15951589
1596- if ( PointedCellChanged is not null
1597- && ! ( _lastCell ? . Column == CurrentCell . Column && _lastCell ? . RowIndex == CurrentCell . RowIndex ) ) //TODO isn't this just `Cell.==`? --yoshi
1590+ if ( PointedCellChanged is not null )
15981591 {
15991592 PointedCellChanged ( this , new CellEventArgs ( _lastCell , CurrentCell ) ) ;
16001593 }
@@ -1607,6 +1600,8 @@ private void CellChanged(Cell newCell)
16071600 {
16081601 _hoverTimer . Stop ( ) ;
16091602 }
1603+
1604+ return true ;
16101605 }
16111606
16121607 private void VerticalBar_ValueChanged ( object sender , EventArgs e )
0 commit comments