public Rectangle getScrollbarRectangle() {
        int scrollbarMaxHeight = (int) ((getBounds().getY() + getBounds().getHeight() - 36) - (getBounds()
                .getY() + 36));
        scrollbarHeight = (int) (scrollbarMaxHeight * (innerPanel.getInitialHeight() / (float) innerPanel.currentHeight));

        if (invertedScrolling) {
            yToDraw = (int) (getBounds().getY() + getBounds().getHeight() - 36 /* margin */);
            yToDraw -= scrollbarHeight;
        } else {
            yToDraw = (int) (getBounds().getY() + 36/* margin */);
        }
        if (scrollY != 0)
            if (invertedScrolling)
                yToDraw -= Math
                        .ceil(scrollbarMaxHeight
                                * (float) ((float) Math.abs(scrollY * lineHeight) / (float) innerPanel.currentHeight));
            else
                yToDraw += Math
                        .floor(scrollbarMaxHeight
                                * (float) ((float) Math.abs(scrollY * lineHeight) / (float) innerPanel.currentHeight));

        if (yToDraw < getBounds().getY() + 36)
            yToDraw = (int) (getBounds().getY() + 36);

        return new Rectangle(
                (int) (getBounds().getX() + getBounds().getWidth() - scrollbarWidth - 5)/* margin */,
                yToDraw, scrollbarWidth, scrollbarHeight - 1);

    }