Changeset 5104 in josm


Ignore:
Timestamp:
Mar 18, 2012 8:45:59 PM (14 months ago)
Author:
xeen
Message:

fix #7523 (thanks Daeron)

File:
1 edited

Legend:

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

    r5100 r5104  
    141141        // repaint required if the helper line is active. 
    142142        boolean needsRepaint = drawHelperLine && !wayIsFinished; 
    143         // move newHighlights to oldHighlights; only update changed primitives 
    144         for(OsmPrimitive x : newHighlights) { 
    145             if(oldHighlights.contains(x)) { 
    146                 continue; 
    147             } 
    148             needsRepaint = true; 
    149             x.setHighlighted(true); 
    150         } 
    151         oldHighlights.removeAll(newHighlights); 
    152         for(OsmPrimitive x : oldHighlights) { 
    153             x.setHighlighted(false); 
    154             needsRepaint = true; 
    155         } 
     143        if(drawTargetHighlight) { 
     144            // move newHighlights to oldHighlights; only update changed primitives 
     145            for(OsmPrimitive x : newHighlights) { 
     146                if(oldHighlights.contains(x)) { 
     147                    continue; 
     148                } 
     149                x.setHighlighted(true); 
     150                needsRepaint = true; 
     151            } 
     152            oldHighlights.removeAll(newHighlights); 
     153            for(OsmPrimitive x : oldHighlights) { 
     154                x.setHighlighted(false); 
     155                needsRepaint = true; 
     156            } 
     157        } 
     158        // required in order to print correct help text 
    156159        oldHighlights = newHighlights; 
    157160 
    158         if ((!drawHelperLine || wayIsFinished) && !drawTargetHighlight) 
     161        if (!needsRepaint && !drawTargetHighlight) 
    159162            return false; 
    160163 
Note: See TracChangeset for help on using the changeset viewer.