aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-13 10:57:33 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-13 10:57:33 +0000
commit46c22d2ccdcfccc8174c34751f63c6a4ca1f022f (patch)
tree3876bd4fa7b85281d2719ae380406415ff3438b7 /src
parent6c84b3d8d0a2b7e22da74a7680c1d8854f5daf7a (diff)
downloadusdx-46c22d2ccdcfccc8174c34751f63c6a4ca1f022f.tar.gz
usdx-46c22d2ccdcfccc8174c34751f63c6a4ca1f022f.tar.xz
usdx-46c22d2ccdcfccc8174c34751f63c6a4ca1f022f.zip
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
Diffstat (limited to '')
-rw-r--r--src/base/UDraw.pas3
1 files changed, 3 insertions, 0 deletions
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);