Changeset 1458 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-03-01T00:09:25+01:00 (16 years ago)
Author:
stoecker
Message:

fixed SHIFT handling in add mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r1457 r1458  
    139139    }
    140140   
     141    /**
     142     * Checks if a map redraw is required and does so if needed. Also updates the status bar
     143     */
    141144    private void redrawIfRequired() {
     145        updateStatusLine();
    142146        if ((!drawHelperLine || wayIsFinished) && !drawTargetHighlight) return;
    143147        Main.map.mapView.repaint();
     
    156160        }
    157161
    158         // This happens when nothing is selected
    159         if(mouseOnExistingNode == null && Main.ds.getSelected().size() == 0 && mousePos != null)
     162        // This happens when nothing is selected, but we still want to highlight the "target node"
     163        if(mouseOnExistingNode == null && Main.ds.getSelected().size() == 0
     164                && mousePos != null && !shift)
    160165            mouseOnExistingNode = Main.map.mapView.getNearestNode(mousePos);
    161166
     
    654659
    655660        if (selectedNode == null) {
    656             if (selectedWay == null) return;
     661            if (selectedWay == null)
     662                return;
    657663            if (selectedWay.isFirstLastNode(lastUsedNode)) {
    658664                currentBaseNode = lastUsedNode;
     
    669675        }
    670676
    671         if (currentBaseNode == null || currentBaseNode == currentMouseNode) {
    672             updateStatusLine();
     677        if (currentBaseNode == null || currentBaseNode == currentMouseNode)
    673678            return; // Don't create zero length way segments.
    674         }
    675679
    676680        // find out the distance, in metres, between the base point and the mouse cursor
     
    685689        Main.map.statusLine.setHeading(hdg);
    686690        Main.map.statusLine.setDist(distance);
    687         updateStatusLine();
     691        // Now done in redrawIfRequired()
     692        //updateStatusLine();
    688693    }
    689694
     
    875880        } else {
    876881            // oldHighlights may store a node or way, check if it's a node
    877             for(OsmPrimitive x : oldHighlights) {
    878                 if(x instanceof Node)
    879                     rv = tr("Select node under cursor.");
    880                 else
    881                     rv = tr("Insert new node into {0} way(s).", oldHighlights.size());
    882                 break;
    883             }
     882            OsmPrimitive x = oldHighlights.iterator().next();
     883            if(x instanceof Node)
     884                rv = tr("Select node under cursor.");
     885            else
     886                rv = tr("Insert new node into {0} way(s).", oldHighlights.size());
    884887        }
    885888
Note: See TracChangeset for help on using the changeset viewer.