Ignore:
Timestamp:
2016-06-24T00:30:42+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #13037 - Small fixes for unit tests (patch by michael2402) - gsoc-core

File:
1 edited

Legend:

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

    r10446 r10467  
    185185
    186186        // update selection to reflect which way being modified
    187         DataSet currentDataSet = getLayerManager().getEditDataSet();
    188         if (getCurrentBaseNode() != null && currentDataSet != null && !currentDataSet.selectionEmpty()) {
     187        OsmDataLayer editLayer = getLayerManager().getEditLayer();
     188        if (getCurrentBaseNode() != null && editLayer != null && !editLayer.data.selectionEmpty()) {
     189            DataSet currentDataSet = editLayer.data;
    189190            Way continueFrom = getWayForNode(getCurrentBaseNode());
    190191            if (alt && continueFrom != null && (!getCurrentBaseNode().isSelected() || continueFrom.isSelected())) {
     
    197198        }
    198199
    199         if (needsRepaint) {
    200             Main.map.mapView.repaint();
     200        if (needsRepaint && editLayer != null) {
     201            editLayer.invalidate();
    201202        }
    202203        return needsRepaint;
     
    917918    @Override
    918919    public void mouseExited(MouseEvent e) {
    919         if (!Main.map.mapView.isActiveLayerDrawable())
     920        OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
     921        if (editLayer == null)
    920922            return;
    921923        mousePos = e.getPoint();
     
    925927        // caused one already, don’t do it again.
    926928        if (!repaintIssued) {
    927             Main.map.mapView.repaint();
     929            editLayer.invalidate();
    928930        }
    929931    }
Note: See TracChangeset for help on using the changeset viewer.