Changeset 5100 in josm for trunk/src


Ignore:
Timestamp:
2012-03-18T12:59:28+01:00 (8 years ago)
Author:
xeen
Message:

fix highlights still being drawn in draw mode when cursor exited the map view

File:
1 edited

Legend:

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

    r5099 r5100  
    137137     * Checks if a map redraw is required and does so if needed. Also updates the status bar
    138138     */
    139     private void redrawIfRequired() {
     139    private boolean redrawIfRequired() {
    140140        updateStatusLine();
    141141        // repaint required if the helper line is active.
     
    157157
    158158        if ((!drawHelperLine || wayIsFinished) && !drawTargetHighlight)
    159             return;
     159            return false;
    160160
    161161        // update selection to reflect which way being modified
     
    177177            Main.map.mapView.repaint();
    178178        }
     179        return needsRepaint;
    179180    }
    180181
     
    864865        mousePos = e.getPoint();
    865866        snapHelper.noSnapNow();
    866         Main.map.mapView.repaint();
     867        boolean repaintIssued = removeHighlighting();
     868        // force repaint in case snapHelper needs one. If removeHighlighting
     869        // caused one already, don’t do it again.
     870        if(!repaintIssued) {
     871            Main.map.mapView.repaint();
     872        }
    867873    }
    868874
     
    10401046    /**
    10411047     * Removes target highlighting from primitives. Issues repaint if required.
     1048     * Returns true if a repaint has been issued.
    10421049     */
    1043     private void removeHighlighting() {
     1050    private boolean removeHighlighting() {
    10441051        newHighlights = new HashSet<OsmPrimitive>();
    1045         redrawIfRequired();
     1052        return redrawIfRequired();
    10461053    }
    10471054
Note: See TracChangeset for help on using the changeset viewer.