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 11
11
using Avalonia . Data ;
12
12
using Avalonia . Input ;
13
13
using Avalonia . Interactivity ;
14
+ using Avalonia . LogicalTree ;
14
15
using Avalonia . Media ;
15
16
using Avalonia . Threading ;
16
17
using Avalonia . VisualTree ;
@@ -1405,7 +1406,9 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)
1405
1406
return ;
1406
1407
1407
1408
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
+
1409
1412
e . Handled = true ;
1410
1413
}
1411
1414
@@ -1458,11 +1461,6 @@ public TextDiffView()
1458
1461
InitializeComponent ( ) ;
1459
1462
}
1460
1463
1461
- public void ScrollToLine ( int line )
1462
- {
1463
- this . FindDescendantOfType < ThemedTextDiffPresenter > ( ) ? . ScrollToLine ( line ) ;
1464
- }
1465
-
1466
1464
protected override void OnPropertyChanged ( AvaloniaPropertyChangedEventArgs change )
1467
1465
{
1468
1466
base . OnPropertyChanged ( change ) ;
You can’t perform that action at this time.
0 commit comments