Move shear amount to constant

This commit is contained in:
Bartłomiej Dach 2022-03-31 22:09:03 +02:00
parent 3ac0da2da3
commit b3896257ca
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
2 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("create button", () => AddStep("create button", () =>
{ {
Child = button = new ShearedToggleButton(0.2f) Child = button = new ShearedToggleButton
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
@ -43,7 +43,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("create button", () => AddStep("create button", () =>
{ {
Child = button = new ShearedToggleButton(0.2f) Child = button = new ShearedToggleButton
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -37,10 +37,12 @@ namespace osu.Game.Graphics.UserInterface
private Sample? sampleOff; private Sample? sampleOff;
private Sample? sampleOn; private Sample? sampleOn;
private const float shear = 0.2f;
[Resolved] [Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!; private OverlayColourProvider colourProvider { get; set; } = null!;
public ShearedToggleButton(float shear) public ShearedToggleButton()
{ {
Height = 50; Height = 50;
Padding = new MarginPadding { Horizontal = shear * 50 }; Padding = new MarginPadding { Horizontal = shear * 50 };