Dynamic scrollbar work

Use the current size of the scrollbar instead of the one set at initialization (user might have resized the window)