In case that the setRange-Method has to adjust the
value (when it is out of the new range) then a
'scroll'-event should be thrown.
I noticed this while using a ViewPane with dynamically
resizing content. Whenever I decreased the size of the
content-layer and the scrollposition was out of the new
scroll-range the viewpane was empty until I moved a
scrollbar.
Because I am too lazy to write a patch I included the
setRange()-method here:)
p.setRange = function(min,max){
this._min=(min!=null)? min:0;
this._max=(max!=null)? max:0;
if(this._value>this._max) {
this._value=this._max;
this.invokeEvent ('scroll');
}
else if(this._value<this._min) {
this._value=this._min;
this.invokeEvent ('scroll');
}
this._adjustKnob();
};
Regards,
Peter
Logged In: YES
user_id=346105
Sorry, was a bit late yesterday ;) The correct
setRange-method would be:
p.setRange = function(min,max){
this._min=(min!=null)? min:0;
this._max=(max!=null)? max:0;
if(this._value>this._max) {
this.setValue(this._max);
}
else if(this._value<this._min) {
this.setValue(this._min);
}
this._adjustKnob();
};
Not just invoking the event, but calling setValue(..).
Regards,
Peter