File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 34
34
<inlines : CopyableGroupedRunInlineTextBlock
35
35
Name =" diagnosticMessageText"
36
36
Grid.Column=" 2"
37
- Margin =" 10 7 5 0 "
37
+ Margin =" 10 7 5 7 "
38
38
VerticalAlignment =" Top"
39
39
TextWrapping =" Wrap"
40
40
FontSize =" 14"
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ namespace Syndiesis.Controls.Inlines;
7
7
8
8
public class GroupedRunInlineTextBlock : TextBlock
9
9
{
10
+ private int ? _textLength ;
10
11
private GroupedRunInlineCollection ? _groupedInlines ;
11
12
12
13
public GroupedRunInlineCollection ? GroupedInlines
@@ -16,6 +17,7 @@ public GroupedRunInlineCollection? GroupedInlines
16
17
{
17
18
_groupedInlines = value ;
18
19
Inlines = _groupedInlines ? . AsInlineCollection ( ) ;
20
+ _textLength = Inlines ? . Text ? . Length ;
19
21
}
20
22
}
21
23
@@ -31,7 +33,13 @@ public void InvalidateText()
31
33
32
34
var hitTest = TextLayout . HitTestPoint ( point ) ;
33
35
if ( ! hitTest . IsInside )
34
- return default ;
36
+ {
37
+ bool hitsCharacter = hitTest . TextPosition < _textLength ;
38
+ if ( ! hitsCharacter )
39
+ {
40
+ return default ;
41
+ }
42
+ }
35
43
36
44
int index = hitTest . TextPosition ;
37
45
return GroupedRunForPosition ( index ) ;
You can’t perform that action at this time.
0 commit comments