private void checkScreenFit() {
        Logger.getLogger(ReadComponent.class.getName()).entering(ReadComponent.class.getName(), "checkScreenFit");
        float ratio = 0;
        if (fitToScreenHorizontally && drawingImageWidth > readInterfaceScrollPane.getWidth()) {
            ratio = (float)readInterfaceScrollPane.getWidth() / (float)drawingImageWidth;
            drawingImageWidth = (int) readInterfaceScrollPane.getWidth();
            drawingImageHeigh = (int) (drawingImageHeigh * ratio);
        }
        if (fitToScreenVertically && drawingImageHeigh > readInterfaceScrollPane.getHeight()) {
            ratio = (float)readInterfaceScrollPane.getHeight() / (float)drawingImageHeigh;
            drawingImageHeigh = (int) readInterfaceScrollPane.getHeight();
            drawingImageWidth = (int) (drawingImageWidth * ratio);
        }
        if (fitToScreenHorizontally || fitToScreenVertically) {
            if (drawingImageHeigh > readInterfaceScrollPane.getHeight()) {
                drawingImageWidth -= readInterfaceScrollPane.getVerticalScrollBar().getWidth();
                drawingImageHeigh -= (readInterfaceScrollPane.getVerticalScrollBar().getWidth() * ratio);
            }
            if (drawingImageWidth > readInterfaceScrollPane.getWidth()) {
                drawingImageHeigh -= readInterfaceScrollPane.getHorizontalScrollBar().getHeight();
                drawingImageWidth -= (readInterfaceScrollPane.getHorizontalScrollBar().getHeight() * ratio);
            }
        }
        Logger.getLogger(ReadComponent.class.getName()).exiting(ReadComponent.class.getName(), "checkScreenFit");
    }