Merge branch 'master' into sharpen

This commit is contained in:
Huo Yaoyuan
2019-11-26 18:21:50 +08:00
113 changed files with 1111 additions and 283 deletions

View File

@ -640,10 +640,19 @@ namespace osu.Game.Screens.Select
itemsCache.Validate();
}
private bool firstScroll = true;
private void updateScrollPosition()
{
if (scrollTarget != null)
{
if (firstScroll)
{
// reduce movement when first displaying the carousel.
scroll.ScrollTo(scrollTarget.Value - 200, false);
firstScroll = false;
}
scroll.ScrollTo(scrollTarget.Value);
scrollPositionCache.Validate();
}
@ -661,8 +670,8 @@ namespace osu.Game.Screens.Select
{
// The radius of the circle the carousel moves on.
const float circle_radius = 3;
double discriminant = Math.Max(0, circle_radius * circle_radius - dist * dist);
float x = (circle_radius - (float)Math.Sqrt(discriminant)) * halfHeight;
float discriminant = MathF.Max(0, circle_radius * circle_radius - dist * dist);
float x = (circle_radius - MathF.Sqrt(discriminant)) * halfHeight;
return 125 + x;
}