@@ -34,31 +34,28 @@ public class OutOfFocusWindow : Window
34
34
private readonly int Thickness = 3 ;
35
35
private readonly Color Color = Color . Red ;
36
36
37
- private readonly int Width ;
38
- private readonly int Height ;
39
-
40
37
public OutOfFocusWindow ( WindowManager owner ) : base ( owner )
41
38
{
42
- Line = new Texture2D ( owner . Viewer . GraphicsDevice , 1 , 1 , false , SurfaceFormat . Color ) ;
39
+ Line = new Texture2D ( Owner . Viewer . GraphicsDevice , 1 , 1 , false , SurfaceFormat . Color ) ;
43
40
Line . SetData ( new [ ] { Color } ) ;
44
-
45
- Width = owner . Viewer . GraphicsDevice . Viewport . Width ;
46
- Height = owner . Viewer . GraphicsDevice . Viewport . Height ;
47
41
}
48
42
49
43
public override void Draw ( SpriteBatch spriteBatch )
50
44
{
45
+ int width = Owner . Viewer . GraphicsDevice . Viewport . Width ;
46
+ int height = Owner . Viewer . GraphicsDevice . Viewport . Height ;
47
+
51
48
// top
52
- DrawLine ( spriteBatch , 0 , 0 , Width , Thickness , 0 ) ;
49
+ DrawLine ( spriteBatch , 0 , 0 , width , Thickness , 0 ) ;
53
50
54
51
// bottom
55
- DrawLine ( spriteBatch , 0 , Height - Thickness , Width , Thickness , 0 ) ;
52
+ DrawLine ( spriteBatch , 0 , height - Thickness , width , Thickness , 0 ) ;
56
53
57
54
// left
58
- DrawLine ( spriteBatch , Thickness , Thickness , Height , Thickness , 90 ) ;
55
+ DrawLine ( spriteBatch , Thickness , Thickness , height , Thickness , 90 ) ;
59
56
60
57
// right
61
- DrawLine ( spriteBatch , Width , Thickness , Height , Thickness , 90 ) ;
58
+ DrawLine ( spriteBatch , width , Thickness , height , Thickness , 90 ) ;
62
59
}
63
60
64
61
private void DrawLine ( SpriteBatch spriteBatch , int X , int Y , int width , int height , int degrees )
0 commit comments