private void resize() {
        width  = getSkinnable().getWidth();
        height = getSkinnable().getHeight();

        if (width > 0 && height > 0) {
            if (aspectRatio * width > height) {
                width = 1 / (aspectRatio / height);
            } else if (1 / (aspectRatio / height) > width) {
                height = aspectRatio * width;
            }

            font = Font.font("Open Sans", FontWeight.EXTRA_BOLD, FontPosture.REGULAR, 0.5 * height);

            background.setPrefSize(width, height);

            selectedText.setFont(font);
            selectedText.setTextOrigin(VPos.CENTER);
            selectedText.relocate(height * 0.3125, (height - selectedText.getLayoutBounds().getHeight()) * 0.5);

            deselectedText.setFont(font);
            deselectedText.setTextOrigin(VPos.CENTER);
            deselectedText.relocate(width - height * 0.3125 - deselectedText.getLayoutBounds().getWidth(), (height - deselectedText.getLayoutBounds().getHeight()) * 0.5);

            thumb.setPrefSize((height * 0.75), (height * 0.75));
            thumb.setTranslateX(getSkinnable().isSelected() ? height * 1.125 : height * 0.125);
            thumb.setTranslateY(height * 0.125);

            moveToDeselected.setFromX(height * 1.125);
            moveToDeselected.setToX(height * 0.125);

            moveToSelected.setFromX(height * 0.125);
            moveToSelected.setToX(height * 1.125);
        }
    }