Skip to content

Commit 6ea1c33

Browse files
committed
👽 Code refactoring.
1 parent f1db428 commit 6ea1c33

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/window/Box2D.Window/CameraView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class CameraView : IView
1616
public CameraView()
1717
{
1818
Position = Vector2.Zero;
19-
Zoom = Constants.MinimumCameraZoom;
19+
Zoom = WindowSettings.MinimumCameraZoom;
2020
}
2121

2222
public void Update()

examples/window/Box2D.Window/SimulationWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ protected override void OnMouseWheel(MouseWheelEventArgs eventArgs)
3838
base.OnMouseWheel(eventArgs);
3939

4040
var value = (float)eventArgs.Value / 1000;
41-
if (value < Constants.MinimumCameraZoom)
41+
if (value < WindowSettings.MinimumCameraZoom)
4242
{
43-
value = Constants.MinimumCameraZoom;
43+
value = WindowSettings.MinimumCameraZoom;
4444
}
4545

4646
if (view != null)
@@ -78,7 +78,7 @@ protected override void OnUpdateFrame(FrameEventArgs eventArgs)
7878
var y = Mouse.GetState().Y;
7979
var direction = new Vector2(x, -y) - view.Position;
8080

81-
view.Position += direction * Constants.MouseMoveSpeed;
81+
view.Position += direction * WindowSettings.MouseMoveSpeed;
8282
}
8383
}
8484
else
@@ -89,7 +89,7 @@ protected override void OnUpdateFrame(FrameEventArgs eventArgs)
8989
var y = GetVertical();
9090
var direction = new Vector2(x, y);
9191

92-
view.Position += direction * Constants.KeyboardMoveSpeed;
92+
view.Position += direction * WindowSettings.KeyboardMoveSpeed;
9393
}
9494
}
9595
}

0 commit comments

Comments
 (0)