From c1005b954b8eeb3ffe154403183a631e2875b520 Mon Sep 17 00:00:00 2001 From: mcmlxxix <> Date: Tue, 9 Aug 2011 17:55:25 +0000 Subject: [PATCH] fix 0 index scrollbar display --- exec/load/scrollbar.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/exec/load/scrollbar.js b/exec/load/scrollbar.js index 28f7e4e93b..e187581431 100644 --- a/exec/load/scrollbar.js +++ b/exec/load/scrollbar.js @@ -6,6 +6,7 @@ function Scrollbar(x,y,length,orientation,color) { this.index; + this.bar; this.x=x; this.y=y; this.orientation=orientation; @@ -16,14 +17,14 @@ function Scrollbar(x,y,length,orientation,color) { if(index>range) return; - if(!index || !range) { - if(!this.index && !this.bar) - return; - } - else if(isNaN(index) || isNaN(range)) + if((isNaN(index) || isNaN(range)) && + (!this.index || !this.bar)) return; + this.index=Math.ceil(((index+1)/range)*this.length); this.bar=Math.ceil((this.length/range)*this.length); + + if(this.orientation == "vertical") this.drawVert(this.index,this.index+this.bar); else -- GitLab