So I’ve created a small class extension with an override function to stop the thumb from scaling on the UIScroller…but I can’t seem to figure out how to do the same for the scrollpane.
Any ideas?
Below you can see that I extend the UIScroller, override the ‘updateThumb()’ function in the ScrollBar class and merely comment out one line:
thumb.height = 12;
// thumb.height = Math.max(13,pageSize / per * track.height);
How can I do the same for the ScrollPane?
Here’s the UIScroller extension:
package
{
import fl.controls.ScrollBar;
import fl.controls.UIScrollBar;
public class ScrollPane_thumb extends fl.controls.UIScrollBar
{
public function ScrollPane_thumb()
override protected function updateThumb():void {
var per:Number = maxScrollPosition - minScrollPosition + pageSize;
if (track.height <= 12 || maxScrollPosition <= minScrollPosition || (per == 0 || isNaN(per))) {
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = 12;
// thumb.height = Math.max(13,pageSize / per * track.height);
thumb.y = track.y+(track.height-thumb.height)*((scrollPosition-minScrollPosition)/(maxScrollPosition-minScrollPosition));
thumb.visible = enabled;
}
}
}
}