private void ScaleViewZoom(int delta, ref AxisSize axis)
        {
            var deltaPos = axis.Size * Settings.Default.ZoomSpeed;

            if (delta > 0)
            {
                deltaPos = -deltaPos;
            }
            axis.Size = axis.Size + deltaPos;
        }
 public ChartRect(ChartArea ca, bool isBorder = false)
 {
     if (isBorder)
     {
         X = new AxisSize(ca.AxisX);
         Y = new AxisSize(ca.AxisY);
     }
     else
     {
         X = new AxisSize(ca.AxisX.ScaleView);
         Y = new AxisSize(ca.AxisY.ScaleView);
     }
 }
 public bool Check(AxisSize old, double minSize, AxisSize border)
 {
     if (Size + minSize * 0.1 > border.Size || minSize * 3 > border.Size)
     {
         this = border;
         return(true);
     }
     if (Size < minSize)
     {
         Size = minSize * 3;
     }
     if (Min < border.Min)
     {
         Shift(border.Min - Min);
         return(true);
     }
     if (Max > border.Max)
     {
         Shift(border.Max - Max);
         return(true);
     }
     return(Math.Abs(old.Min - Min) + Math.Abs(old.Max - Max) > minSize * 0.1);
 }
 public ChartRect(double xMin, double xMax, double yMin, double yMax)
 {
     X = new AxisSize(xMin, xMax);
     Y = new AxisSize(yMin, yMax);
 }
 public ChartRect(ChartRect other)
 {
     X = other.X;
     Y = other.Y;
 }
 public ChartRect()
 {
     X = Y = new AxisSize(double.PositiveInfinity, double.NegativeInfinity);
 }