Ticket #2240: This Haunts Me Part 2.patch

File This Haunts Me Part 2.patch, 1.7 KB (added by xeen, 16 years ago)
  • org/openstreetmap/josm/actions/mapmode/DrawAction.java

     
    242242    public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
    243243        if(!Main.map.mapView.isDrawableLayer())
    244244            return;
     245        wayIsFinished = false;
    245246        computeHelperLine();
    246247        addHighlighting();
    247248        redrawIfRequired();
     
    805806    }
    806807
    807808    public void paint(Graphics g, MapView mv) {
    808         if (!drawHelperLine) return;
     809        if (!drawHelperLine || wayIsFinished) return;
    809810
    810811        // sanity checks
    811812        if (Main.map.mapView == null) return;
     
    881882        /*
    882883         * Check whether a connection will be made
    883884         */
    884         if (currentBaseNode != null) {
     885        if (currentBaseNode != null && !wayIsFinished) {
    885886            if(alt)
    886887                rv += " " + tr("Start new way from last node.");
    887888            else
    888889                rv += " " + tr("Continue way from last node.");
    889890        }
    890 
     891       
     892        Node n = mouseOnExistingNode;
    891893        /*
    892894         * Handle special case: Highlighted node == selected node => finish drawing
    893895         */
    894         Node n = mouseOnExistingNode;
     896       
    895897        if(n != null && Main.ds.getSelectedNodes().contains(n)) {
    896             rv = tr("Finish drawing.");
     898            if(wayIsFinished)
     899                rv = tr("Select node under cursor.");
     900            else
     901                rv = tr("Finish drawing.");
    897902        }
    898903
    899904        /*