Changeset 2520 in josm for trunk


Ignore:
Timestamp:
2009-11-27T20:34:35+01:00 (12 years ago)
Author:
stoecker
Message:

small code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java

    r2519 r2520  
    238238     */
    239239    public void resizeSlippyMap() {
     240        int w, h;
     241
     242        // retrieve the size of the display
    240243        Dimension iScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
     244
    241245        // enlarge
    242246        if(iDownloadDialogDimension == null) {
     247            // make the each dimension 90% of the absolute display size
     248            w = iScreenSize.width * 90 / 100;
     249            h = iScreenSize.height * 90 / 100;
    243250            iDownloadDialogDimension = iGui.getSize();
    244             // make the each dimension 90% of the absolute display size and
    245             // center the DownloadDialog
    246             // retrieve the size of the display
    247             int w = iScreenSize.width * 90 / 100;
    248             int h = iScreenSize.height * 90 / 100;
    249             iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);
    250251        }
    251252        // shrink
    252253        else {
    253             // set the size back to the initial dimensions and center the
    254             // DownloadDialog
    255             int w = iDownloadDialogDimension.width;
    256             int h = iDownloadDialogDimension.height;
    257             iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);
     254            // set the size back to the initial dimensions
     255            w = iDownloadDialogDimension.width;
     256            h = iDownloadDialogDimension.height;
    258257            iDownloadDialogDimension = null;
    259258        }
     259
     260        // resize and center the DownloadDialog
     261        iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);
    260262
    261263        repaint();
Note: See TracChangeset for help on using the changeset viewer.