void () { Rectangle bounds = imageComponent.getDocument().getBounds(); if (bounds != null) { final double zoom = getZoomModel().getZoomFactor(); imageComponent.setCanvasSize((int)Math.ceil(bounds.width * zoom), (int)Math.ceil(bounds.height * zoom)); } }