/// <summary> /// Checks whether this key overlaps with another specified key definition. /// </summary> /// <param name="otherKey">The other key to check for overlapping on.</param> /// <returns><c>True</c> if the keys overlap, <c>false</c> otherwise.</returns> public bool BordersWith(KeyDefinition otherKey) { var clipper = new Clipper(); clipper.AddPath(this.GetPath(), PolyType.ptSubject, true); clipper.AddPath(otherKey.GetPath(), PolyType.ptClip, true); var union = new List <List <IntPoint> >(); clipper.Execute(ClipType.ctUnion, union); return(union.Count == 1); }
/// <summary> /// Checks whether this key overlaps with another specified key definition. /// </summary> /// <param name="otherKey">The other key to check for overlapping on.</param> /// <returns><c>True</c> if the keys overlap, <c>false</c> otherwise.</returns> public bool BordersWith(KeyDefinition otherKey) { var clipper = new Clipper(); clipper.AddPath(this.GetPath(), PolyType.ptSubject, true); clipper.AddPath(otherKey.GetPath(), PolyType.ptClip, true); var union = new List<List<IntPoint>>(); clipper.Execute(ClipType.ctUnion, union); return union.Count == 1; }