This second argument are so called stylebits. An ```int``` value is internally made of 32 Bits so we got 32 positions to store a value. This allows for a very flexible styling of a widget. In our case, if the 8th Bit is set, our widget has an horizontal bar and if the 9th Bit is set we got a vertical bar. This is delegated to the canvas constructor which in turn creates those objects for us.
This second argument are so called **stylebits**. An ```int``` value is internally made of 32 Bits so we got 32 positions to store a value. This allows for a very flexible styling of a widget. In our case, if the 8th Bit is set, our widget has an horizontal bar and if the 9th Bit is set we got a vertical bar. This is delegated to the canvas constructor which in turn creates those objects for us.
An object with both bits set would require the following call:
Now we can start to discuss why the horizontal bar stores **pixel** while the vertical bar stored **lines**. This is a decision i made and origins from the following thought process:
**Vertical Scrolling**
At some time during our process, we need to calculate the complete height of the content of the widget. Otherwise we could not scale the scrollbar accordingly. Since all we draw is text and text usually comes in lines, the total height is just the sum of the heights of all individual lines + a constant space in between them. While it would be possible to store the height in pixel, no one can actually read lines that are just partly visible. This is why i decided to only scroll full lines.
** Horizontal scrolling**
The maximum width can only be calculated in pixel, since the other metric (character) is not reliable between different fonts.