From 46c22d2ccdcfccc8174c34751f63c6a4ca1f022f Mon Sep 17 00:00:00 2001
From: tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Sun, 13 Jun 2010 10:57:33 +0000
Subject: avoid time bar overflows by restricting its range

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2514 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 src/base/UDraw.pas | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src')

diff --git a/src/base/UDraw.pas b/src/base/UDraw.pas
index 308526b8..5bec3eab 100644
--- a/src/base/UDraw.pas
+++ b/src/base/UDraw.pas
@@ -1140,6 +1140,9 @@ begin
        (LyricsState.TotalTime > 0) then
     begin
       LyricsProgress := CurLyricsTime / LyricsState.TotalTime;
+      // avoid that the bar "overflows" for inaccurate song lengths
+      if (LyricsProgress > 1.0) then
+        LyricsProgress := 1.0;
       glTexCoord2f((width * LyricsProgress) / 8, 0);
       glVertex2f(x + width * LyricsProgress, y);
 
-- 
cgit v1.2.3