Пример #1
0
        /// <summary>
        /// Return the steps it takes to go from the current value to value*ratio.
        /// </summary>
        /// <param name="ratio">Ratio that needs to be converted to steps. Can be smaller than one</param>
        /// <returns>the number of steps. Will be negative when ratio smaller than 1</returns>
        public int StepsNeededForRatio(double ratio)
        {
            DiscreteScale newScale = new DiscreteScale();

            newScale.ApproximateTo(ratio * ScaleValue);
            int neededSteps = newScale.stepIndex - this.stepIndex;

            neededSteps += discreteSteps.Count() * (newScale.powerOfTen - this.powerOfTen);
            return(neededSteps);
        }
Пример #2
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="drawScaleRuler">The Scale ruler that needs to be updated on screen and zoom sizes</param>
 public DrawArea(DrawScaleRuler drawScaleRuler)
 {
     AreaW          = 1230;
     AreaH          = 700;
     metersPerPixel = new DiscreteScale();
     MouseLocation  = new WorldLocation(0, 0, 0, 0, 0); // default mouse location far far away
     fontManager    = FontManager.Instance;
     SetDrawArea(-1, 1, -1, 1);                         // just have a default
     this.drawScaleRuler = drawScaleRuler;
 }