Fix delayed perfect line effect (#704)

* Fix delayed perfect line effect

* Address Sonarcloud issues for CNoteBars.cs

* Fix out of range bug caused by removing last()
This commit is contained in:
Jiiniasu authored and GitHub committed 2024-08-18 14:53:25 +02:00
1 parent 75854549b7
commit 8023b61a41
1 file changed
+3 -3
+3 -3
View File
@@ -145,10 +145,10 @@ namespace VocaluxeLib.Menu.SingNotes
} }
} }
if (_CurrentLine > 0 && sungLines.Count >= _CurrentLine && sungLines[_CurrentLine - 1].PerfectLine) if (sungLines.Count > 0 && sungLines[sungLines.Count - 1].PerfectLine)
{ {
_AddPerfectLine(); _AddPerfectLine();
sungLines[_CurrentLine - 1].PerfectLine = false; sungLines[sungLines.Count - 1].PerfectLine = false;
} }
_Flares.RemoveAll(el => !el.IsAlive); _Flares.RemoveAll(el => !el.IsAlive);
@@ -237,7 +237,7 @@ namespace VocaluxeLib.Menu.SingNotes
CBase.Drawing.DrawTexture(toneHelper, drawRect, color, false); CBase.Drawing.DrawTexture(toneHelper, drawRect, color, false);
} }
private void _DrawNote(SRectF rect, SColorF color, CTextureRef noteBegin, CTextureRef noteMiddle, CTextureRef noteEnd, float factor) private static void _DrawNote(SRectF rect, SColorF color, CTextureRef noteBegin, CTextureRef noteMiddle, CTextureRef noteEnd, float factor)
{ {
if (factor <= 0) if (factor <= 0)
return; return;