csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
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.
41 lines
1.2 KiB
41 lines
1.2 KiB
// -----------------------------------------------------------------------
|
|
// <copyright file="Direct2DStreamGeometry.cs" company="Steven Kirk">
|
|
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|
// </copyright>
|
|
// -----------------------------------------------------------------------
|
|
|
|
namespace Perspex.Direct2D1.Media
|
|
{
|
|
using System;
|
|
using Perspex.Media;
|
|
using Perspex.Platform;
|
|
using SharpDX.Direct2D1;
|
|
using Splat;
|
|
|
|
public class StreamGeometryImpl : GeometryImpl, IStreamGeometryImpl
|
|
{
|
|
private PathGeometry geometry;
|
|
|
|
public StreamGeometryImpl()
|
|
{
|
|
Factory factory = Locator.Current.GetService<Factory>();
|
|
this.geometry = new PathGeometry(factory);
|
|
this.Geometry = this.geometry;
|
|
}
|
|
|
|
public override Rect Bounds
|
|
{
|
|
get { return geometry.GetBounds().ToPerspex(); }
|
|
}
|
|
|
|
public override Rect GetRenderBounds(double strokeThickness)
|
|
{
|
|
return geometry.GetWidenedBounds((float)strokeThickness).ToPerspex();
|
|
}
|
|
|
|
public IStreamGeometryContextImpl Open()
|
|
{
|
|
return new StreamGeometryContextImpl(geometry.Open());
|
|
}
|
|
}
|
|
}
|
|
|