}
};
@Override
public void onDraw(Canvas canvas) {
int contentHeight = canvas.calculateRestrictedSize(content, new Vector2i(canvas.size().x, Integer.MAX_VALUE)).y;
if (canvas.size().y < contentHeight) {
int scrollbarWidth = canvas.calculateRestrictedSize(scrollbar, canvas.size()).x;
contentHeight = canvas.calculateRestrictedSize(content, new Vector2i(canvas.size().x - scrollbarWidth, Integer.MAX_VALUE)).y;
boolean atBottom = scrollbar.getRange() == scrollbar.getValue();
Rect2i contentRegion = Rect2i.createFromMinAndSize(0, 0, canvas.size().x - scrollbarWidth, canvas.size().y);
scrollbar.setRange(contentHeight - contentRegion.height());