public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime) { base.PrepareFrame(frame, elapsedTime); CircularSpeedGauge.PrepareFrame(); CircularSpeedGauge.SizeTo(DrawPosition.Width, DrawPosition.Height); if (Math.Abs(1f - PrevScale / CircularSpeedGauge.Scale) > 0.1f) { PrevScale = CircularSpeedGauge.Scale; CircularSpeedGauge.SetFont(); } }
/// <summary> /// Resize control to fit into a new rectangle, by keeping aspect ratio. /// </summary> /// <param name="width">The new width of the control</param> /// <param name="height">The new height of the control</param> public void SizeTo(int width, int height) { Position.Width = width; Position.Height = height; CircularSpeedGauge.SizeTo(width, height); }