ZForge.Controls.ExplorerBar.Expando.UpdateSlideAnimation C# (CSharp) Méthode

UpdateSlideAnimation() protected méthode

Updates the next "frame" of a slide animation
protected UpdateSlideAnimation ( int animationStepNum, int numAnimationSteps ) : void
animationStepNum int The current step in the animation
numAnimationSteps int The total number of steps in the animation
Résultat void
        protected internal void UpdateSlideAnimation(int animationStepNum, int numAnimationSteps)
        {
            // the percentage we need to adjust our height by
            // double step = (1 / (double) numAnimationSteps) * animationStepNum;
            // replacement by: Joel Holdsworth ([email protected])
            //                 Paolo Messina ([email protected])
            //                 05/06/2004
            //                 v1.1
            double step = (1.0 - Math.Cos(Math.PI * (double) animationStepNum / (double) numAnimationSteps)) / 2.0;

            // set the height of the group
            this.Height = this.expandedHeight + (int) ((this.slideEndHeight - this.expandedHeight) * step);

            if (this.TaskPane != null)
            {
                this.TaskPane.DoLayout();
            }
            else
            {
                // draw the next frame
                this.Invalidate();
            }
        }