Browse Source

Translate TextNode bounds by offset.

The bounds of `TextNode` must include the offset passed to the constructor.
Steven Kirk 6 years ago
parent
commit
523dcf5d30
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Avalonia.Visuals/Rendering/SceneGraph/TextNode.cs

+ 1 - 1
src/Avalonia.Visuals/Rendering/SceneGraph/TextNode.cs

@@ -27,7 +27,7 @@ namespace Avalonia.Rendering.SceneGraph
             Point origin,
             IFormattedTextImpl text,
             IDictionary<IVisual, Scene> childScenes = null)
-            : base(text.Bounds, transform, null)
+            : base(text.Bounds.Translate(origin), transform, null)
         {
             Transform = transform;
             Foreground = foreground?.ToImmutable();