File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1111using Avalonia . Data ;
1212using Avalonia . Input ;
1313using Avalonia . Interactivity ;
14+ using Avalonia . LogicalTree ;
1415using Avalonia . Media ;
1516using Avalonia . Threading ;
1617using Avalonia . VisualTree ;
@@ -1405,7 +1406,9 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)
14051406 return ;
14061407
14071408 var line = Math . Max ( 1 , Math . Min ( total , ( int ) Math . Ceiling ( pressedY * total / height ) ) ) ;
1408- this . FindAncestorOfType < TextDiffView > ( ) ? . ScrollToLine ( line ) ;
1409+ if ( this . Parent is Control parent )
1410+ parent . FindLogicalDescendantOfType < ThemedTextDiffPresenter > ( ) ? . ScrollToLine ( line ) ;
1411+
14091412 e . Handled = true ;
14101413 }
14111414
@@ -1458,11 +1461,6 @@ public TextDiffView()
14581461 InitializeComponent ( ) ;
14591462 }
14601463
1461- public void ScrollToLine ( int line )
1462- {
1463- this . FindDescendantOfType < ThemedTextDiffPresenter > ( ) ? . ScrollToLine ( line ) ;
1464- }
1465-
14661464 protected override void OnPropertyChanged ( AvaloniaPropertyChangedEventArgs change )
14671465 {
14681466 base . OnPropertyChanged ( change ) ;
You can’t perform that action at this time.
0 commit comments