|
|
|
@ -306,6 +306,7 @@ namespace ICSharpCode.AvalonEdit.Rendering
@@ -306,6 +306,7 @@ namespace ICSharpCode.AvalonEdit.Rendering
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the visual column from a document position (relative to top left of the document).
|
|
|
|
|
/// If the user clicks between two visual columns, rounds to the nearest column.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int GetVisualColumn(Point point) |
|
|
|
|
{ |
|
|
|
@ -314,6 +315,17 @@ namespace ICSharpCode.AvalonEdit.Rendering
@@ -314,6 +315,17 @@ namespace ICSharpCode.AvalonEdit.Rendering
|
|
|
|
|
return ch.FirstCharacterIndex + ch.TrailingLength; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the visual column from a document position (relative to top left of the document).
|
|
|
|
|
/// If the user clicks between two visual columns, returns the first of those columns.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int GetVisualColumnFloor(Point point) |
|
|
|
|
{ |
|
|
|
|
TextLine textLine = GetTextLineByVisualYPosition(point.Y); |
|
|
|
|
CharacterHit ch = textLine.GetCharacterHitFromDistance(point.X); |
|
|
|
|
return ch.FirstCharacterIndex; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets whether the visual line was disposed.
|
|
|
|
|
/// </summary>
|
|
|
|
|