@@ -34,31 +34,28 @@ public class OutOfFocusWindow : Window
3434 private readonly int Thickness = 3 ;
3535 private readonly Color Color = Color . Red ;
3636
37- private readonly int Width ;
38- private readonly int Height ;
39-
4037 public OutOfFocusWindow ( WindowManager owner ) : base ( owner )
4138 {
42- Line = new Texture2D ( owner . Viewer . GraphicsDevice , 1 , 1 , false , SurfaceFormat . Color ) ;
39+ Line = new Texture2D ( Owner . Viewer . GraphicsDevice , 1 , 1 , false , SurfaceFormat . Color ) ;
4340 Line . SetData ( new [ ] { Color } ) ;
44-
45- Width = owner . Viewer . GraphicsDevice . Viewport . Width ;
46- Height = owner . Viewer . GraphicsDevice . Viewport . Height ;
4741 }
4842
4943 public override void Draw ( SpriteBatch spriteBatch )
5044 {
45+ int width = Owner . Viewer . GraphicsDevice . Viewport . Width ;
46+ int height = Owner . Viewer . GraphicsDevice . Viewport . Height ;
47+
5148 // top
52- DrawLine ( spriteBatch , 0 , 0 , Width , Thickness , 0 ) ;
49+ DrawLine ( spriteBatch , 0 , 0 , width , Thickness , 0 ) ;
5350
5451 // bottom
55- DrawLine ( spriteBatch , 0 , Height - Thickness , Width , Thickness , 0 ) ;
52+ DrawLine ( spriteBatch , 0 , height - Thickness , width , Thickness , 0 ) ;
5653
5754 // left
58- DrawLine ( spriteBatch , Thickness , Thickness , Height , Thickness , 90 ) ;
55+ DrawLine ( spriteBatch , Thickness , Thickness , height , Thickness , 90 ) ;
5956
6057 // right
61- DrawLine ( spriteBatch , Width , Thickness , Height , Thickness , 90 ) ;
58+ DrawLine ( spriteBatch , width , Thickness , height , Thickness , 90 ) ;
6259 }
6360
6461 private void DrawLine ( SpriteBatch spriteBatch , int X , int Y , int width , int height , int degrees )
0 commit comments