From 65de336d6e8f0643014392406e5a17da709bcfc8 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 24 Aug 2024 15:19:41 +0800 Subject: [PATCH] Make the idol/hover caret state better. --- .../DrawableCreateRemoveTimeTagCaret.cs | 18 ++++-- .../Lyrics/Carets/DrawableCuttingCaret.cs | 6 +- .../Carets/DrawableRecordingTimeTagCaret.cs | 55 ++++++++++++------- 3 files changed, 52 insertions(+), 27 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableCreateRemoveTimeTagCaret.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableCreateRemoveTimeTagCaret.cs index 30bb20291..45541384f 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableCreateRemoveTimeTagCaret.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableCreateRemoveTimeTagCaret.cs @@ -27,8 +27,8 @@ public partial class DrawableCreateRemoveTimeTagCaret : DrawableCaret { + private const float caret_width = 10; + private readonly Container splitter; private readonly SpriteIcon splitIcon; public DrawableCuttingCaret(DrawableCaretState state) : base(state) { - Width = 10; + Width = caret_width; Origin = Anchor.TopCentre; InternalChildren = new Drawable[] @@ -87,7 +89,7 @@ protected override void ApplyCaretPosition(CuttingCaretPosition caret) { var rect = LyricPositionProvider.GetRectByCharIndicator(caret.CharGap); - Position = rect.TopLeft; + Position = rect.TopLeft + new Vector2(rect.Width / 2 - caret_width / 2, 0); Height = rect.Height; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableRecordingTimeTagCaret.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableRecordingTimeTagCaret.cs index 4907cc91d..b26f9269a 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableRecordingTimeTagCaret.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableRecordingTimeTagCaret.cs @@ -21,8 +21,8 @@ public partial class DrawableRecordingTimeTagCaret : DrawableCaret