1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-22 22:17:46 +08:00

Fix border / slider body metrics

This commit is contained in:
Dean Herbert 2022-09-19 17:05:36 +09:00
parent 4eae5f8733
commit c8206b747b
5 changed files with 20 additions and 17 deletions

View File

@ -23,9 +23,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
public class ArgonMainCirclePiece : CompositeDrawable
{
public const float BORDER_THICKNESS = 7;
public const float BORDER_THICKNESS = (OsuHitObject.OBJECT_RADIUS * 2) * (2f / 58);
public const float OUTER_GRADIENT_SIZE = OsuHitObject.OBJECT_RADIUS * 2 - BORDER_THICKNESS * 3;
public const float GRADIENT_THICKNESS = BORDER_THICKNESS * 2.5f;
public const float OUTER_GRADIENT_SIZE = (OsuHitObject.OBJECT_RADIUS * 2) - BORDER_THICKNESS * 4;
public const float INNER_GRADIENT_SIZE = OUTER_GRADIENT_SIZE - GRADIENT_THICKNESS * 2;
public const float INNER_FILL_SIZE = INNER_GRADIENT_SIZE - GRADIENT_THICKNESS * 2;
private readonly Circle outerFill;
private readonly Circle outerGradient;
@ -49,8 +54,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
const float fill_thickness = 24;
InternalChildren = new Drawable[]
{
outerFill = new Circle // renders white outer border and dark fill
@ -67,14 +70,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
},
innerGradient = new Circle // renders the inner bright gradient
{
Size = new Vector2(OUTER_GRADIENT_SIZE - fill_thickness),
Size = new Vector2(INNER_GRADIENT_SIZE),
Alpha = 1,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
innerFill = new Circle // renders the inner dark fill
{
Size = new Vector2(OUTER_GRADIENT_SIZE - 2 * fill_thickness),
Size = new Vector2(INNER_FILL_SIZE),
Alpha = 1,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
Masking = true;
BorderThickness = ArgonMainCirclePiece.BORDER_THICKNESS * 2;
BorderThickness = ArgonMainCirclePiece.GRADIENT_THICKNESS;
BorderColour = Color4.White;
InternalChildren = new Drawable[]

View File

@ -11,15 +11,17 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
protected override void LoadComplete()
{
const float path_radius = ArgonMainCirclePiece.OUTER_GRADIENT_SIZE / 2;
base.LoadComplete();
AccentColourBindable.BindValueChanged(accent =>
{
BorderColour = accent.NewValue;
}, true);
ScaleBindable.BindValueChanged(scale => PathRadius = ArgonMainCirclePiece.OUTER_GRADIENT_SIZE / 2 * scale.NewValue, true);
AccentColourBindable.BindValueChanged(accent => BorderColour = accent.NewValue, true);
ScaleBindable.BindValueChanged(scale => PathRadius = path_radius * scale.NewValue, true);
BorderSize = ArgonMainCirclePiece.BORDER_THICKNESS / 4;
// This border size thing is kind of weird, hey.
const float intended_thickness = ArgonMainCirclePiece.GRADIENT_THICKNESS / path_radius;
BorderSize = intended_thickness / Default.DrawableSliderPath.BORDER_PORTION;
}
protected override Default.DrawableSliderPath CreateSliderPath() => new DrawableSliderPath();

View File

@ -10,8 +10,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public abstract class DrawableSliderPath : SmoothPath
{
protected const float BORDER_PORTION = 0.128f;
protected const float GRADIENT_PORTION = 1 - BORDER_PORTION;
public const float BORDER_PORTION = 0.128f;
public const float GRADIENT_PORTION = 1 - BORDER_PORTION;
private const float border_max_size = 8f;
private const float border_min_size = 0f;

View File

@ -1,8 +1,6 @@
// 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.
#nullable disable
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;