Example #1
0
        /// <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));
        }
Example #2
0
 /// <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));
 }
Example #3
0
        /// <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));
        }
Example #4
0
 /// <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));
     }
 }
Example #5
0
        /// <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));
        }
Example #6
0
 /// <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));
 }