Skip to content

Commit 00060a8

Browse files
Some "Codacy Static Code Analysis — 4 new issues (0 max.) of at least minor severity." solved
1 parent d4518c6 commit 00060a8

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

Source/RunActivity/Viewer3D/Popups/OutOfFocusWindow.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,9 @@ public OutOfFocusWindow(WindowManager owner) : base(owner)
3939
Height = owner.Viewer.GraphicsDevice.Viewport.Height;
4040
}
4141

42-
public override void Draw(SpriteBatch SpriteBatch)
42+
private float ConvertToRadiansFromDegrees(int angle)
4343
{
44-
// top
45-
DrawLine(SpriteBatch, 0, 0, Width, Thickness, 0);
46-
47-
// bottom
48-
DrawLine(SpriteBatch, 0, Height - Thickness, Width, Thickness, 0);
49-
50-
// left
51-
DrawLine(SpriteBatch, Thickness, Thickness, Height, Thickness, 90);
52-
53-
// right
54-
DrawLine(SpriteBatch, Width, Thickness, Height, Thickness, 90);
44+
return (float)((System.Math.PI / 180) * angle);
5545
}
5646

5747
private void DrawLine(SpriteBatch SpriteBatch, int X, int Y, int width, int height, int degrees)
@@ -61,14 +51,24 @@ private void DrawLine(SpriteBatch SpriteBatch, int X, int Y, int width, int heig
6151
new Rectangle(X, Y, width, height),
6252
null,
6353
Color,
64-
(float)ConvertToRadiansFromDegrees(degrees),
54+
ConvertToRadiansFromDegrees(degrees),
6555
new Vector2(0, 0),
6656
SpriteEffects.None, 0);
67-
}
57+
}
6858

69-
private float ConvertToRadiansFromDegrees(int angle)
59+
public override void Draw(SpriteBatch SpriteBatch)
7060
{
71-
return (float)((System.Math.PI / 180) * angle);
61+
// top
62+
DrawLine(SpriteBatch, 0, 0, Width, Thickness, 0);
63+
64+
// bottom
65+
DrawLine(SpriteBatch, 0, Height - Thickness, Width, Thickness, 0);
66+
67+
// left
68+
DrawLine(SpriteBatch, Thickness, Thickness, Height, Thickness, 90);
69+
70+
// right
71+
DrawLine(SpriteBatch, Width, Thickness, Height, Thickness, 90);
7272
}
7373
}
7474
}

Source/RunActivity/Viewer3D/Popups/Window.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public abstract class Window : RenderPrimitive
4545
VertexBuffer WindowVertexBuffer;
4646
IndexBuffer WindowIndexBuffer;
4747

48-
readonly bool DoNotDisplayWindow = false;
48+
readonly bool DoNotDisplayWindow;
4949

5050
public Window(WindowManager owner, int width, int height, string caption)
5151
{
@@ -65,10 +65,11 @@ public Window(WindowManager owner, int width, int height, string caption)
6565
}
6666

6767
Caption = caption;
68+
DoNotDisplayWindow = false;
6869
Owner.Add(this);
6970
}
7071

71-
public Window(WindowManager owner)
72+
protected Window(WindowManager owner)
7273
{
7374
Owner = owner;
7475
DoNotDisplayWindow = true;

0 commit comments

Comments
 (0)