From 3a2e13be2265b5af07cdd533545b58ed2139f84c Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Wed, 25 May 2022 15:10:43 +0200 Subject: [PATCH] Add missing file --- .../Media/TextFormatting/TextRunBounds.cs | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/Avalonia.Base/Media/TextFormatting/TextRunBounds.cs diff --git a/src/Avalonia.Base/Media/TextFormatting/TextRunBounds.cs b/src/Avalonia.Base/Media/TextFormatting/TextRunBounds.cs new file mode 100644 index 0000000000..91150160ed --- /dev/null +++ b/src/Avalonia.Base/Media/TextFormatting/TextRunBounds.cs @@ -0,0 +1,39 @@ +namespace Avalonia.Media.TextFormatting +{ + /// + /// The bounding rectangle of text run + /// + public sealed class TextRunBounds + { + /// + /// Constructing TextRunBounds + /// + internal TextRunBounds(Rect bounds, int firstCharacterIndex, int length, TextRun textRun) + { + Rectangle = bounds; + TextSourceCharacterIndex = firstCharacterIndex; + Length = length; + TextRun = textRun; + } + + /// + /// First text source character index of text run + /// + public int TextSourceCharacterIndex { get; } + + /// + /// character length of bounded text run + /// + public int Length { get; } + + /// + /// Text run bounding rectangle + /// + public Rect Rectangle { get; } + + /// + /// text run + /// + public TextRun TextRun { get; } + } +}