private void resizeWidthDependsOnHeight(){
setScrollbars();
setViewPortSize();
if(viewPortSize.getX() == 0 || viewPortSize.getY() == 0 ) return;
distributeSizeWidthDependsOnHeight();
Dimension major = figure.getMajorDimension();
Dimension minor = major.other();
if(scrollBars.get(minor) != null && figure.size.get(minor) > viewPortSize.get(minor) && !scrollBars.get(minor).isVisible()){
scrollBars.get(minor).setVisible(true);
scrollBarsVisible.set(minor,true);
} else if(scrollBars.get(minor) != null && figure.size.get(minor) <= viewPortSize.get(minor) && scrollBarsVisible.get(minor)){
scrollBarsVisible.set(minor,false);