Browse Source

Fix Issue 3825

pull/4517/head
Murdo R Ergeaux 6 years ago
parent
commit
c57ce7f5fc
  1. 4
      src/Avalonia.Visuals/Media/GlyphRun.cs
  2. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/GlyphRunNode.cs

4
src/Avalonia.Visuals/Media/GlyphRun.cs

@ -555,7 +555,7 @@ namespace Avalonia.Media
} }
} }
return new Rect(0, 0, width, height); return new Rect(0, GlyphTypeface.Ascent * Scale, width, height);
} }
private void Set<T>(ref T field, T value) private void Set<T>(ref T field, T value)
@ -595,8 +595,6 @@ namespace Avalonia.Media
_glyphRunImpl = platformRenderInterface.CreateGlyphRun(this, out var width); _glyphRunImpl = platformRenderInterface.CreateGlyphRun(this, out var width);
var height = (GlyphTypeface.Descent - GlyphTypeface.Ascent + GlyphTypeface.LineGap) * Scale; var height = (GlyphTypeface.Descent - GlyphTypeface.Ascent + GlyphTypeface.LineGap) * Scale;
_bounds = new Rect(0, 0, width, height);
} }
void IDisposable.Dispose() void IDisposable.Dispose()

2
src/Avalonia.Visuals/Rendering/SceneGraph/GlyphRunNode.cs

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

Loading…
Cancel
Save