/// <summary> /// /// </summary> /// <param name="segmentWidth"></param> /// <param name="segmentHeight"></param> /// <param name="align"></param> /// <returns></returns> internal Point GetLinePoint(double segmentWidth, double segmentHeight, out TickAlignment align) { double num; double num2; double num3; double num4; ArrangeTick(out num, out num2, out align); if (align == TickAlignment.LeftOrTop) { num3 = num; num4 = num + num2; } else if (align == TickAlignment.RightOrBottom) { num3 = segmentHeight - num; num4 = segmentHeight - (num + num2); } else { num3 = (segmentHeight - num2) / 2.0; num4 = segmentHeight - ((segmentHeight - num2) / 2.0); } return(new Point(num3, num4)); }
void ArrangeTick(out double start, out double length, out TickAlignment align) { align = TickAlignment.RightOrBottom; start = 0.0; if ((this.Value % this.Segment.PxSegmentWidth) == 0.0) { length = this.Segment.Ruler.Thickness; } else { length = this.Segment.Ruler.Thickness * 0.3; } }
// <summary> /// To update the ticks values start value, length, alignment /// </summary> /// <param name="start">Start value</param> /// <param name="length">Length of the tick</param> /// <param name="align">Alignment of the tick</param> protected override void ArrangeTick(out double start, out double length, out TickAlignment align) { start = 0; if (Value % 200 == 0) { length = 20; } else if (Value % 100 == 0 || Value % 100 < 2) { length = 14; } else if (Value % 50 == 0) { length = 9; } else { length = 5; } align = TickAlignment.RightOrBottom; }