Browse Source

Fix crash when selecting disabled MeshSprays

Clement Espeute 2 years ago
parent
commit
1c8c0bbc29
2 changed files with 3 additions and 0 deletions
  1. 1 0
      hrt/prefab/l3d/Layers2D.hx
  2. 2 0
      hrt/prefab/l3d/MeshSpray.hx

+ 1 - 0
hrt/prefab/l3d/Layers2D.hx

@@ -357,6 +357,7 @@ class Layers2D extends hrt.prefab.Object3D {
 	}
 
 	function createInteractiveBrush(ectx : hide.prefab.EditContext) {
+		if (!enabled) return;
 		editorCtx = ectx;
 		var ctx = ectx.getContext(this);
 		var s2d = ctx.shared.root2d.getScene();

+ 2 - 0
hrt/prefab/l3d/MeshSpray.hx

@@ -743,7 +743,9 @@ class MeshSpray extends Spray {
 
 	override function createInteractiveBrush(ectx : EditContext) {
 		super.createInteractiveBrush(ectx);
+		if (!enabled) return;
 		var ctx = ectx.getContext(this);
+
 		var s2d = ctx.shared.root2d.getScene();
 
 		interactive.onMove = function(e) {