Debug - 2009-05-15

Progress bars with an initial value whose value does not get changed every frame did not render correctly

Moving some code around so we removed some from here

            this.bContinuous = bContinuous;
            if (this.bContinuous)
                style = Style.Continuous;
            else
                style = Style.Blocks;
        }

Added it back here

            area.Width = (int)Width;
            area.Height = (int)Height;

            numberOfBlocks = progressBar.Width / blockWidth;

            sourceRect = new Rectangle(0, 0, progressBar.Width, progressBar.Height);
            destRect = new Rectangle((int)Position.X + 2, (int)Position.Y + 2, (int)(progressBar.Width * value / 100f), progressBar.Height);

And copied some here

            pixel = new Color[progressBar.Width * progressBar.Height];

            int totalBlocks = (int)System.Math.Round((float)numberOfBlocks * ((float)value / 100f));

            destRect.Width = blockWidth * totalBlocks;
            sourceRect.Width = destRect.Width;

            for (int y = 0; y < progressBar.Height; y++)
            {
                for (int x = 0; x < progressBar.Width; x++)
                {