if (sf != factor) { th.scale(factor); double ratio = factor/sf; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); }
if (sf != factor) th.scale(factor);
    public void visit(ImageNode node)    {        Rectangle r = node.getBounds();        Thumbnail th = node.getThumbnail();        double sf = th.getScalingFactor();        double factor = ZoomCmd.calculateFactor(sf);        if (sf != factor) {            th.scale(factor);            double ratio = factor/sf;            node.setLocation((int) (r.x*ratio), (int) (r.y*ratio));        }    }