Revision 4084

View differences:

org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingContext.java
151 151
//    private boolean processing;
152 152
    
153 153
    private int drawMode;
154
    
155
    private Set<FLyrVect> removeFromSnapping;
154 156

  
155 157
    private final LayerListener layerListener = new LayerListener() {
156 158

  
......
306 308
        this.serviceStack = new Stack<>();
307 309
        
308 310
        this.drawMode = DRAWMODE_NORMAL;
311
        
312
        this.removeFromSnapping = new HashSet<>();
309 313

  
310 314
        addLayerListeners();
311 315
        addPreferenceListener();
......
589 593
            Set<FLyrVect> layersToSnap = getMapControl().getMapContext().getLayersToSnap();
590 594
            if (!layersToSnap.contains(currentLayer)) {
591 595
                layersToSnap.add(currentLayer);
596
                this.removeFromSnapping.add(currentLayer);
592 597
            }
593 598
        }
594 599
    }
......
598 603
        Set<FLyrVect> layersToSnap =
599 604
            getMapControl().getMapContext().getLayersToSnap();
600 605
        if (layersToSnap.contains(currentLayer)) {
601
            layersToSnap.remove(currentLayer);
606
            if(this.removeFromSnapping.contains(currentLayer)){
607
                layersToSnap.remove(currentLayer);
608
                this.removeFromSnapping.remove(currentLayer);
609
            }
602 610
        }
603 611
    }
604 612

  

Also available in: Unified diff