Skip to content

Commit 25cedf3

Browse files
TimtyGpandinocoder
authored andcommitted
Panda Review 2
1 parent f7a3604 commit 25cedf3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Intersect.Client.Core/MonoGame/Input/MonoInput.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private void CheckMouseButton(Keys modifier, ButtonState bs, MouseButton mb)
237237
}
238238
}
239239

240-
private const double ZoomDelayInMilliseconds = 300;
240+
private static readonly TimeSpan ZoomDelay = TimeSpan.FromMilliseconds(300);
241241
private DateTime _lastZoomTime = DateTime.MinValue;
242242

243243
private void CheckMouseScrollWheel(int scrlVValue, int scrlHValue)
@@ -255,7 +255,7 @@ private void CheckMouseScrollWheel(int scrlVValue, int scrlHValue)
255255
var deltaV = Math.Sign(mMouseVScroll - scrlVValue);
256256

257257
var now = DateTime.Now;
258-
if ((now - _lastZoomTime).TotalMilliseconds >= ZoomDelayInMilliseconds)
258+
if (now - _lastZoomTime >= ZoomDelay)
259259

260260
{
261261

@@ -265,14 +265,14 @@ private void CheckMouseScrollWheel(int scrlVValue, int scrlHValue)
265265
&& Globals.GameState == GameStates.InGame
266266
&& Globals.Database.EnableScrollingWorldZoom)
267267
{
268-
if (deltaV < 0)
269-
{
270-
Core.Input.HandleZoomIn(false);
271-
}
272-
else
273-
{
274-
Core.Input.HandleZoomOut(false);
275-
}
268+
if (deltaV < 0)
269+
{
270+
Core.Input.HandleZoomIn(false);
271+
}
272+
else
273+
{
274+
Core.Input.HandleZoomOut(false);
275+
}
276276
_lastZoomTime = now;
277277
}
278278
}

0 commit comments

Comments
 (0)