A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
781 B

using System;
using System.Collections.Generic;
using Avalonia.Media.TextFormatting;
using Avalonia.Platform;
namespace Avalonia.UnitTests
{
public class MockGlyphRun : IGlyphRunImpl
{
public MockGlyphRun(IReadOnlyList<GlyphInfo> glyphInfos)
{
var width = 0.0;
for (var i = 0; i < glyphInfos.Count; ++i)
{
width += glyphInfos[i].GlyphAdvance;
}
Bounds = new Rect(new Size(width, 10));
}
public Rect Bounds { get; }
public Point BaselineOrigin => new Point(0, 8);
public void Dispose()
{
}
public IReadOnlyList<float> GetIntersections(float lowerBound, float upperBound)
=> Array.Empty<float>();
}
}