1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:02:55 +08:00

Fix incorrect shear masking on nested textbox

This commit is contained in:
Dean Herbert 2022-05-03 14:45:17 +09:00
parent bc88c4ee8e
commit b5ea26f2fa

View File

@ -21,7 +21,6 @@ namespace osu.Game.Graphics.UserInterface
private const float corner_radius = 7;
private readonly Box background;
private readonly Box searchBoxBackground;
private readonly SearchTextBox textBox;
public Bindable<string> Current
@ -60,30 +59,12 @@ namespace osu.Game.Graphics.UserInterface
{
new Drawable[]
{
new Container
textBox = new InnerSearchTextBox
{
Name = @"Search box container",
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.Both,
CornerRadius = corner_radius,
Masking = true,
Children = new Drawable[]
{
searchBoxBackground = new Box
{
RelativeSizeAxes = Axes.Both
},
textBox = new InnerSearchTextBox
{
Shear = -Shear,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.X,
Padding = new MarginPadding
{
Horizontal = corner_radius + Shear.X
}
}
}
Size = Vector2.One
},
new Container
{
@ -119,7 +100,6 @@ namespace osu.Game.Graphics.UserInterface
private void load(OverlayColourProvider colourProvider)
{
background.Colour = colourProvider.Background3;
searchBoxBackground.Colour = colourProvider.Background4;
}
public override bool HandleNonPositionalInput => textBox.HandleNonPositionalInput;
@ -134,6 +114,9 @@ namespace osu.Game.Graphics.UserInterface
Placeholder.Font = OsuFont.GetFont(size: CalculatedTextSize, weight: FontWeight.SemiBold);
PlaceholderText = CommonStrings.InputSearch;
CornerRadius = corner_radius;
TextContainer.Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0);
}
protected override SpriteText CreatePlaceholder() => new SearchPlaceholder();