Fixed layer changing when selecting cabinets and adding new ones.
Fixed layer changing when selecting cabinets and adding new ones.

--- a/source/lib/scripts/CabinetEditor/CabinetEditor.js
+++ b/source/lib/scripts/CabinetEditor/CabinetEditor.js
@@ -21,7 +21,7 @@
 		'CabinetEditor/Config',

 

 		'Geometry/Point2D',

-		

+

 		'Util/UI'

 

 	],

@@ -105,6 +105,7 @@
 

 		this.selected_cabinet = cabinet;

 		this.selected_face = "front_face";

+		this.setLayer(cabinet.getLayer(), true);

 

 	};

 


--- a/source/lib/scripts/CabinetEditor/Tools/Item/AddCabinetTool.js
+++ b/source/lib/scripts/CabinetEditor/Tools/Item/AddCabinetTool.js
@@ -76,7 +76,7 @@
 			&& this.editor.collisions.length == 0){
 			this.cabinet.id = this.editor.schematic.newID();
 			this.editor.schematic.objects.push(this.cabinet);
-			this.editor.schematic.selected_layer = this.cabinet.getLayer();
+			this.editor.setLayer(this.cabinet.getLayer());
 
 			this.editor.pushToUndoBuffer(
 				{