Skip to content
Snippets Groups Projects
Commit c1005b95 authored by mcmlxxix's avatar mcmlxxix
Browse files

fix 0 index scrollbar display

parent 5802b8b1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment