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:
parent
85fedbd025
commit
61a9c6fd7e
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user