//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Drawing.Shapes.PolygonClipper
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using Paths;
///
/// Compares s
///
internal class IntersectNodeSort : IComparer
{
///
/// Compares the specified node1.
///
/// The node1.
/// The node2.
///
/// 1 if node2 %gt; node1
/// -1 if node2 $lt; node1
/// 0 if same
///
public int Compare(IntersectNode node1, IntersectNode node2)
{
float i = node2.Pt.Y - node1.Pt.Y;
if (i > 0)
{
return 1;
}
else if (i < 0)
{
return -1;
}
else
{
return 0;
}
}
}
}