[xiph-commits] r17723 - trunk/squishyball
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Mon Dec 6 17:37:02 PST 2010
Author: xiphmont
Date: 2010-12-06 17:37:02 -0800 (Mon, 06 Dec 2010)
New Revision: 17723
Modified:
trunk/squishyball/tty.c
Log:
Cosmetic cleanup un the playbar
Modified: trunk/squishyball/tty.c
===================================================================
--- trunk/squishyball/tty.c 2010-12-06 21:02:04 UTC (rev 17722)
+++ trunk/squishyball/tty.c 2010-12-07 01:37:02 UTC (rev 17723)
@@ -162,9 +162,10 @@
static int draw_playbar(int row){
int pre = floor(p_st/p_len*columns);
- int post = columns-floor(p_end/p_len*columns+1.e-6f);
+ int post = floor(p_end/p_len*columns+1.e-6f);
int i;
playrow=row;
+ if(post>columns-1)post=columns-1;
i=0;
min_mvcur(0,row);
@@ -174,7 +175,7 @@
i++;
}
min_bg(COLOR_BLACK);
- while(i<(columns-post)){
+ while(i<=post){
min_putchar(' ');
i++;
}
@@ -370,14 +371,14 @@
if(was!=now || force){
int pre = floor(p_st/p_len*columns);
- int post = columns-floor(p_end/p_len*columns+1.e-6f);
+ int post = floor(p_end/p_len*columns+1.e-6f);
min_bold(1);
min_gfx(1);
if(was>=0){
min_mvcur(was,playrow);
- if(was<pre || (columns-was)<post){
+ if(was<pre || was>post){
min_color(COLOR_YELLOW,COLOR_CYAN);
}else{
min_color(COLOR_YELLOW,COLOR_BLACK);
@@ -387,11 +388,7 @@
was=now;
min_mvcur(now,playrow);
- if(now<pre || (columns-now)<post){
- min_bg(COLOR_CYAN);
- }else{
- min_bg(COLOR_BLACK);
- }
+ min_bg(COLOR_BLACK);
min_putchar(ACS_VLINE);
min_unset();
}
More information about the commits
mailing list