if (areaSelection && roi.getType()==Roi.RECTANGLE)
imp.deleteRoi();
ic.setSourceRect(new Rectangle(x-srcWidth/2,y-srcHeight/2,srcWidth,srcHeight));
ic.setMagnification(mag);
Insets insets = win.getInsets();
<BUG>int margins = IJ.isMacOSX()?10:14;
int stackInset = (imp.getNDimensions()-2)*15;
win.setSize((int)(srcWidth*mag+insets.right+insets.left+margins), (int)(srcHeight*mag+insets.top+insets.bottom+margins+stackInset));

return;</BUG>
}

if (areaSelection && roi.getType()==Roi.RECTANGLE)
imp.deleteRoi();
ic.setSourceRect(new Rectangle(x-srcWidth/2,y-srcHeight/2,srcWidth,srcHeight));
ic.setMagnification(mag);
Insets insets = win.getInsets();
win.setSize((int)(srcWidth*mag+insets.right+insets.left+ImageWindow.HGAP*2), (int)(srcHeight*mag+insets.top+insets.bottom+ImageWindow.VGAP*2+win.getSliderHeight()));return;
}
