1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 19:53:08 +08:00

Disable Truncate in OsuSpriteText

Co-Authored-By: Salman Ahmed <frenzibyte@gmail.com>
This commit is contained in:
Joseph Madamba 2023-06-10 11:53:45 -07:00
parent 85fedbd025
commit 61a9c6fd7e
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76
3 changed files with 11 additions and 5 deletions

View File

@ -3,12 +3,19 @@
#nullable disable
using System;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Graphics.Sprites
{
public partial class OsuSpriteText : SpriteText
{
[Obsolete("Use TruncatingSpriteText instead.")]
public new bool Truncate
{
set => throw new InvalidOperationException($"Use {nameof(TruncatingSpriteText)} instead.");
}
public OsuSpriteText()
{
Shadow = true;

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
namespace osu.Game.Graphics.Sprites
@ -14,7 +15,7 @@ namespace osu.Game.Graphics.Sprites
public TruncatingSpriteText()
{
Truncate = true;
((SpriteText)this).Truncate = true;
}
}
}

View File

@ -118,22 +118,20 @@ namespace osu.Game.Overlays.Mods
Direction = FillDirection.Vertical,
Children = new[]
{
titleText = new OsuSpriteText
titleText = new TruncatingSpriteText
{
Font = OsuFont.TorusAlternate.With(size: 18, weight: FontWeight.SemiBold),
RelativeSizeAxes = Axes.X,
Truncate = true,
Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0),
Margin = new MarginPadding
{
Left = -18 * ShearedOverlayContainer.SHEAR
}
},
descriptionText = new OsuSpriteText
descriptionText = new TruncatingSpriteText
{
Font = OsuFont.Default.With(size: 12),
RelativeSizeAxes = Axes.X,
Truncate = true,
Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0)
}
}