mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
simplify CreateEmphasisedSpriteText
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using Markdig.Syntax.Inlines;
|
using Markdig.Syntax.Inlines;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers.Markdown;
|
using osu.Framework.Graphics.Containers.Markdown;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -28,10 +29,6 @@ namespace osu.Game.Graphics.Containers.Markdown
|
|||||||
=> AddText(codeInline.Content, t => { t.Colour = colourProvider.Light1; });
|
=> AddText(codeInline.Content, t => { t.Colour = colourProvider.Light1; });
|
||||||
|
|
||||||
protected override SpriteText CreateEmphasisedSpriteText(bool bold, bool italic)
|
protected override SpriteText CreateEmphasisedSpriteText(bool bold, bool italic)
|
||||||
{
|
=> CreateSpriteText().With(t => t.Font = t.Font.With(weight: bold ? FontWeight.Bold : FontWeight.Regular, italics: italic));
|
||||||
var spriteText = CreateSpriteText();
|
|
||||||
spriteText.Font = spriteText.Font.With(weight: bold ? FontWeight.Bold : FontWeight.Regular, italics: italic);
|
|
||||||
return spriteText;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user