← All bug reports

FS#333Add layer: new layer should be active one

Type
Bug
Status
Closed
Resolution
Fixed
Category
QCAD (main)
Severity
Low
Priority
Low
Reported version
3 Beta 3
Target version
3.0.0
Operating system
All
Reported
2011-10-24 by andrew
Closed
2011-10-24 by andrew

Add layer: new layer should be active one

Comments (1)

andrew 2011-10-24

Immediate fix for beginEvent in:
scripts/Layer/AddLayer/AddLayer.js:

AddLayer.prototype.beginEvent = function() {
    Layer.prototype.beginEvent.call(this);

    var dlg = new LayerDialog(this.getDocument());
    this.layer = dlg.show();
    if (isNull(this.layer)) {
        this.terminate();
        return;
    }
    
    var operation = new RAddObjectOperation(this.layer);
    var di = this.getDocumentInterface();
    di.applyOperation(operation);

    // make new layer the current layer:
    di.setCurrentLayer(this.layer);

    di.clearPreview();
    di.repaintViews();

    this.terminate();
};