Ignore:
Timestamp:
2009-08-05T10:05:50+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3193: No layer is left highlighted when the bottom most one is deleted
fixed some references to Way.nodes
clean up of warnings
added documentation in LayerListDialog

File:
1 edited

Legend:

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

    r1910 r1911  
    145145     */
    146146    public void mousePressed(MouseEvent e) {
    147         if (e.getButton() == MouseEvent.BUTTON1)
     147        if (e.getButton() == MouseEvent.BUTTON1) {
    148148            mousePosStart = mousePos = e.getPoint();
     149        }
    149150    }
    150151
     
    157158
    158159        if (buttonPressed != 0) {
    159             if (mousePosStart == null)
     160            if (mousePosStart == null) {
    160161                mousePosStart = mousePos = e.getPoint();
     162            }
    161163            paintRect();
    162164        }
     
    191193        boolean alt = (e.getModifiersEx() & MouseEvent.ALT_DOWN_MASK) != 0;
    192194        boolean ctrl = (e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) != 0;
    193         if ((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == 0)
     195        if ((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == 0) {
    194196            selectionEndedListener.selectionEnded(r, alt, shift, ctrl);
     197        }
    195198    }
    196199
     
    235238            if ((double)w/h < aspectRatio) {
    236239                int neww = (int)(h*aspectRatio);
    237                 if (mousePos.x < mousePosStart.x)
     240                if (mousePos.x < mousePosStart.x) {
    238241                    x += w - neww;
     242                }
    239243                w = neww;
    240244            } else {
    241245                int newh = (int)(w/aspectRatio);
    242                 if (mousePos.y < mousePosStart.y)
     246                if (mousePos.y < mousePosStart.y) {
    243247                    y += h - newh;
     248                }
    244249                h = newh;
    245250            }
     
    275280        if (clicked) {
    276281            OsmPrimitive osm = nc.getNearest(center);
    277             if (osm != null)
     282            if (osm != null) {
    278283                selection.add(osm);
     284            }
    279285        } else {
    280286            // nodes
    281287            for (Node n : nc.getCurrentDataSet().nodes) {
    282                 if (!n.deleted && !n.incomplete && r.contains(nc.getPoint(n)))
     288                if (!n.deleted && !n.incomplete && r.contains(nc.getPoint(n))) {
    283289                    selection.add(n);
     290                }
    284291            }
    285292
    286293            // ways
    287294            for (Way w : nc.getCurrentDataSet().ways) {
    288                 if (w.deleted || w.getNodesCount() == 0 || w.incomplete)
    289                         continue;
     295                if (w.deleted || w.getNodesCount() == 0 || w.incomplete) {
     296                    continue;
     297                }
    290298                if (alt) {
    291299                    for (Node n : w.getNodes()) {
     
    303311                        }
    304312                    }
    305                     if (allIn) selection.add(w);
     313                    if (allIn) {
     314                        selection.add(w);
     315                    }
    306316                }
    307317            }
Note: See TracChangeset for help on using the changeset viewer.