/// <inheritdoc cref="BaseLabel.CompareTo"/> public override int CompareTo(BaseLabel other) { var lbThis = new LabelBox(Location.GetBounds()); var lbOther = other is PathLabel otherPl ? new LabelBox(otherPl.Location.GetBounds()) : other.Box; return(lbThis.CompareTo(lbOther)); }
/// <summary> /// Tests if two label boxes intersects /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(BaseLabel other) { if (this == other) { return(0); } if (_box == null) { return(-1); } if (other.Box == null) { return(1); } return(_box.CompareTo(other.Box)); }
/// <summary> /// Tests if two label boxes intersects /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(Label other) { if (this == other) { return(0); } if (box == null) { return(other.box == null ? ComparePoints(labelPoint, other.LabelPoint) : ComparePointToBox(labelPoint, other.Box)); } if (other.Box == null) { return(ComparePointToBox(other.LabelPoint, Box)); } return(box.CompareTo(other.Box)); }
/// <summary> /// Tests if two label boxes intersects /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(Label other) { if (this == other) { return(0); } else if (_box == null) { return(-1); } else if (other.Box == null) { return(1); } else { return(_box.CompareTo(other.Box)); } }
/// <summary> /// Tests if two label boxes intersects /// </summary> /// <param name="other"></param> /// <returns></returns> public virtual int CompareTo(BaseLabel other) { // if (this.TextOnPathLabel != null) // { // return CompareToTextOnPath(other); // } if (this == other) { return(0); } if (_box == null) { return(-1); } if (other.Box == null) { return(1); } return(_box.CompareTo(other.Box)); }
/// <summary> /// Tests if two label boxes intersects /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(BaseLabel other) { if (this.TextOnPathLabel != null) { return(CompareToTextOnPath(other)); } if (this == other) { return(0); } if (_box == null) { return(-1); } if (other.Box == null) { return(1); } return(_box.CompareTo(other.Box)); }