PathGeometryHelper.cs 612 B

123456789101112131415161718192021222324
  1. using System.Windows.Media;
  2. namespace HandyControl.Expression.Drawing;
  3. internal static class PathGeometryHelper
  4. {
  5. public static bool IsStroked(this PathSegment pathSegment) => pathSegment.IsStroked;
  6. public static PathGeometry AsPathGeometry(this Geometry original)
  7. {
  8. if (original == null)
  9. {
  10. return null;
  11. }
  12. if (!(original is PathGeometry geometry))
  13. {
  14. return PathGeometry.CreateFromGeometry(original);
  15. }
  16. return geometry;
  17. }
  18. internal static Geometry FixPathGeometryBoundary(Geometry geometry) => geometry;
  19. }