improved lyric zoom effect (TODO: add lyric style option to config screen)
This commit is contained in:
1 parent
8dbdd7423e
commit
fd482606e7
1 file changed
+18
-12
+18
-12
@@ -317,32 +317,36 @@ namespace Vocaluxe.Menu
|
||||
}
|
||||
|
||||
int zoom_note = -1;
|
||||
int end_beat = -1;
|
||||
float zoomx = 0f;
|
||||
|
||||
int current_note = -1;
|
||||
foreach (SNote note in _Notes)
|
||||
for (int note = 0; note < _Notes.Count; note++)
|
||||
{
|
||||
current_note++;
|
||||
|
||||
_Text.X = x;
|
||||
_Text.Style = EStyle.Bold;
|
||||
_Text.Text = note.Text;
|
||||
_Text.Text = _Notes[note].Text;
|
||||
RectangleF rect = CDraw.GetTextBounds(_Text);
|
||||
|
||||
if (note.Type == ENoteType.Freestyle)
|
||||
if (_Notes[note].Type == ENoteType.Freestyle)
|
||||
_Text.Style = EStyle.BoldItalic;
|
||||
|
||||
if (CurrentBeat >= note.StartBeat)
|
||||
if (CurrentBeat >= _Notes[note].StartBeat)
|
||||
{
|
||||
if (CurrentBeat <= note.EndBeat)
|
||||
bool last = note == _Notes.Count -1;
|
||||
int endbeat = _Notes[note].EndBeat;
|
||||
if (note < _Notes.Count -1)
|
||||
endbeat = _Notes[note + 1].StartBeat - 1;
|
||||
|
||||
if (CurrentBeat <= endbeat)
|
||||
{
|
||||
zoom_note = current_note;
|
||||
zoom_note = note;
|
||||
end_beat = endbeat;
|
||||
zoomx = _Text.X;
|
||||
}
|
||||
else
|
||||
{
|
||||
// already passed
|
||||
if (current_note == last_note)
|
||||
if (note == last_note)
|
||||
_Text.Color = ColorProcessed;
|
||||
else
|
||||
_Text.Color = Color;
|
||||
@@ -376,9 +380,11 @@ namespace Vocaluxe.Menu
|
||||
|
||||
RectangleF rect = CDraw.GetTextBounds(_Text);
|
||||
|
||||
float diff = _Notes[zoom_note].EndBeat - _Notes[zoom_note].StartBeat;
|
||||
float diff = end_beat - _Notes[zoom_note].StartBeat;
|
||||
if (diff <= 0f)
|
||||
diff = 1f;
|
||||
|
||||
float p = (CurrentBeat - _Notes[zoom_note].StartBeat) / _Notes[zoom_note].Duration;
|
||||
float p = (CurrentBeat - _Notes[zoom_note].StartBeat) / diff;
|
||||
if (p > 1f)
|
||||
p = 1f;
|
||||
|
||||
|
||||
Reference in new issue
Block a user