mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
.NET Standard 2.1 implements Math.Clamp , use it instead of MathHelper.Clamp from osuTK.
This commit is contained in:
@ -99,7 +99,7 @@ namespace osu.Game.Overlays.Chat.Tabs
|
||||
private void tabCloseRequested(TabItem<Channel> tab)
|
||||
{
|
||||
int totalTabs = TabContainer.Count - 1; // account for selectorTab
|
||||
int currentIndex = MathHelper.Clamp(TabContainer.IndexOf(tab), 1, totalTabs);
|
||||
int currentIndex = Math.Clamp(TabContainer.IndexOf(tab), 1, totalTabs);
|
||||
|
||||
if (tab == SelectedTab && totalTabs > 1)
|
||||
// Select the tab after tab-to-be-removed's index, or the tab before if current == last
|
||||
|
@ -217,7 +217,7 @@ namespace osu.Game.Overlays.Music
|
||||
break;
|
||||
}
|
||||
|
||||
dstIndex = MathHelper.Clamp(dstIndex, 0, items.Count - 1);
|
||||
dstIndex = Math.Clamp(dstIndex, 0, items.Count - 1);
|
||||
|
||||
if (srcIndex == dstIndex)
|
||||
return;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -8,7 +9,6 @@ using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Overlays.Profile.Header.Components
|
||||
{
|
||||
@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
||||
{
|
||||
set
|
||||
{
|
||||
int count = MathHelper.Clamp(value, 0, 3);
|
||||
int count = Math.Clamp(value, 0, 3);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user