瀏覽代碼

Add missing file

Benedikt Stebner 3 年之前
父節點
當前提交
3a2e13be22
共有 1 個文件被更改,包括 39 次插入0 次删除
  1. 39 0
      src/Avalonia.Base/Media/TextFormatting/TextRunBounds.cs

+ 39 - 0
src/Avalonia.Base/Media/TextFormatting/TextRunBounds.cs

@@ -0,0 +1,39 @@
+namespace Avalonia.Media.TextFormatting
+{
+    /// <summary>
+    /// The bounding rectangle of text run
+    /// </summary>
+    public sealed class TextRunBounds
+    {
+        /// <summary>
+        /// Constructing TextRunBounds
+        /// </summary>
+        internal TextRunBounds(Rect bounds, int firstCharacterIndex, int length, TextRun textRun)
+        {
+            Rectangle = bounds;
+            TextSourceCharacterIndex = firstCharacterIndex;
+            Length = length;
+            TextRun = textRun;
+        }
+
+        /// <summary>
+        /// First text source character index of text run
+        /// </summary>
+        public int TextSourceCharacterIndex { get; }
+
+        /// <summary>
+        /// character length of bounded text run
+        /// </summary>
+        public int Length { get; }
+
+        /// <summary>
+        /// Text run bounding rectangle
+        /// </summary>
+        public Rect Rectangle { get; }
+
+        /// <summary>
+        /// text run
+        /// </summary>
+        public TextRun TextRun { get; }
+    }
+}